knotchain

package
v0.0.0-...-4bc3810 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version1      byte = 0x01
	NotCompressed byte = 0
	Deflate       byte = 1
	Encrypted     byte = 1
)

Variables

View Source
var Base32LowerCaseEncoding = base32.NewEncoding("abcdefghijklmnopqrstuvwxyz234567").WithPadding(base32.NoPadding)
View Source
var ErrNoKnotToUntie error = fmt.Errorf("no more knot to untie")

Functions

func KnotString

func KnotString(k Knot) string

func TieChain

func TieChain(chain *KnotChain) ([]byte, error)

func TieChainToHostname

func TieChainToHostname(chain *KnotChain, stemHostname string) (string, error)

Types

type Knot

type Knot interface {
	Type() byte
	Host() string
	Port() uint16
	Encode() []byte
	Length() int
	DialContext(context.Context, string) (net.Conn, error)
}

func Untie

func Untie(b []byte, stemHostname string) (Knot, []byte, error)

Untie the first knot in the chain, returning the untied knot and a new encoded chain

func UntieHostname

func UntieHostname(hostname string) (Knot, string, error)

UntieHostname untie the knot chain from the hostname. It returns the untied knot and a new hostname.

type KnotChain

type KnotChain struct {
	Version byte
	Knots   []Knot
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL