network

package
v0.0.0-...-6427680 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeUUID

func MakeUUID() uuid.UUID

func MustMarshal

func MustMarshal(i interface{}) []byte

func MustUnmarshal

func MustUnmarshal(bytes []byte, ptr interface{})

Types

type Client

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

func NewClient

func NewClient(info ConnInfo) *Client

func (*Client) Dial

func (client *Client) Dial() (func() error, Tunnel, error)

type ConnInfo

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

func MakeConnInfo

func MakeConnInfo(host string, port int, id uuid.UUID, pemPath, certPath string) ConnInfo

type Message

type Message struct {
	ClientID    uuid.UUID
	Content     json.RawMessage
	ContentType string
}

func MakeMessage

func MakeMessage(clientID uuid.UUID, contents interface{}) Message

func (Message) String

func (message Message) String() string

type Server

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

func NewServer

func NewServer(info ConnInfo) *Server

func (*Server) Serve

func (server *Server) Serve() (func() error, chan Tunnel, error)

type Tunnel

type Tunnel struct {
	ID       uuid.UUID
	Incoming chan Message
	Outgoing chan Message
	Closed   chan struct{}
}

Jump to

Keyboard shortcuts

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