portal

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Receive

func Receive(ctx context.Context, dst io.Writer, password string, config *Config) error

Receive executes the portal receive sequence. The payload is written to the provided writer. The provided config will be merged with the default config.

func Send

func Send(ctx context.Context, payload io.Reader, payloadSize int64, config *Config) (string, error, chan error)

Send executes the portal send sequence. The intial connection with the Rendezous server is performed synchronously, after that the transfer sequence is performed asynchronously. The function returns a portal password, a error from the rendezvous intial rendezvous connection, and a channel on which errors from the transfer sequence can be listend to. The provided config will be merged with the default config.

Types

type Config

type Config struct {
	RendezvousAddr string `json:"RendezvousAddr,omitempty"`
}

Config specifes a config for the portal module.

func MergeConfig

func MergeConfig(dst Config, src *Config) Config

MergeConfig merges the specified source config into the specified destination config. Values present in the source config will overide values in the destination config.

func MergeConfigReader

func MergeConfigReader(dst Config, r io.Reader) Config

MergeConfigReader merges the config from the reader with into the provided config. Values in the reader will override values in the provided config

Jump to

Keyboard shortcuts

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