transit

package
v0.0.0-...-17e3a4f Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AbilityDirectTcpV1 string = "direct-tcp-v1"
)

Variables

View Source
var (
	RoleReceiver string = "receiver"
	RoleSender   string = "sender"
)
View Source
var (
	ErrDecryption error = errors.New("decryption failed")
	ErrProtocol   error = errors.New("protocol fail")
)

Functions

func LocalIpAddresses

func LocalIpAddresses() []string

Types

type Ability

type Ability struct {
	Type string `json:"type"`
}

type Config

type Config struct {
	Abilities []Ability `json:"abilities-v1"`
	Hints     []Hint    `json:"hints-v1"`
}

TODO abilities and hints should move to transfer.go

type Hint

type Hint struct {
	Type     string  `json:"type"`
	Hostname string  `json:"hostname"`
	Port     int     `json:"port"`
	Priority float64 `json:"priority"`
	Hints    []Hint  `json:"hints"`
}

type Transit

type Transit struct {
	// contains filtered or unexported fields
}

func New

func New(w *wormhole.Client, role string) *Transit

func (*Transit) Close

func (t *Transit) Close() error

func (*Transit) Connect

func (t *Transit) Connect() error

func (*Transit) Flush

func (t *Transit) Flush() error

func (*Transit) OurAbilities

func (t *Transit) OurAbilities() Config

func (*Transit) Read

func (t *Transit) Read(b []byte) (int, error)

TODO n, err

func (Transit) Role

func (t Transit) Role() string

func (*Transit) TheirAbilities

func (t *Transit) TheirAbilities(c Config)

TODO and hints

func (*Transit) Write

func (t *Transit) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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