docks

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CraneMsgTypeEnd              = 0
	CraneMsgTypeInfo             = 1
	CraneMsgTypeRequestHubInfo   = 2
	CraneMsgTypeVerify           = 3
	CraneMsgTypeStartEncrypted   = 4
	CraneMsgTypeStartUnencrypted = 5
)
View Source
const ExpandOpType string = "expand"
View Source
const (
	QOTD = "Privacy is not an option, and it shouldn't be the price we accept for just getting on the Internet.\nGary Kovacs\n"
)

Variables

View Source
var (
	CraneStatusStopped int8 = -1
	CraneStatusPrivate int8 = 0
	CraneStatusPublic  int8 = 1
)

Crane Status Options.

View Source
var (
	ErrDone = errors.New("crane is done")
)

Errors.

Functions

func AssignCrane

func AssignCrane(hubID string, crane *Crane)

func GetAllAssignedCranes added in v0.3.5

func GetAllAssignedCranes() map[string]*Crane

func ImportAndVerifyHubInfo added in v0.3.0

func ImportAndVerifyHubInfo(ctx context.Context, hubID string, announcementData, statusData []byte, mapName string, scope hub.Scope) (h *hub.Hub, forward bool, tErr *terminal.Error)

func RegisterCraneUpdateHook added in v0.3.0

func RegisterCraneUpdateHook(fn func(crane *Crane))

RegisterCraneUpdateHook allows the captain to hook into receiving updates for cranes.

Types

type BlockingSubmitQueue added in v0.3.0

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

func NewBlockingSubmitQueue added in v0.3.0

func NewBlockingSubmitQueue(size int) *BlockingSubmitQueue

type BlockingSubmitter added in v0.3.0

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

type Crane

type Crane struct {
	// ID is the ID of the Crane.
	ID string

	// ConnectedHub is the identity of the remote Hub.
	ConnectedHub *hub.Hub

	// Controller is the Crane's Controller Terminal.
	Controller *CraneControllerTerminal
	// contains filtered or unexported fields
}

func GetAssignedCrane

func GetAssignedCrane(hubID string) *Crane

func NewCrane

func NewCrane(ctx context.Context, ship ships.Ship, connectedHub *hub.Hub, id *cabin.Identity) (*Crane, error)

func (*Crane) AbandonTerminal added in v0.3.0

func (crane *Crane) AbandonTerminal(id uint32, err *terminal.Error)

func (*Crane) EstablishNewTerminal added in v0.3.0

func (crane *Crane) EstablishNewTerminal(
	localTerm terminal.TerminalInterface,
	initData *container.Container,
) *terminal.Error

func (*Crane) LocalAddr added in v0.3.0

func (crane *Crane) LocalAddr() net.Addr

func (*Crane) NotifyUpdate added in v0.3.0

func (crane *Crane) NotifyUpdate()

NotifyUpdate calls the registers crane update hook function.

func (*Crane) Public added in v0.3.0

func (crane *Crane) Public() bool

func (*Crane) Publish added in v0.3.0

func (crane *Crane) Publish() error

func (*Crane) RemoteAddr added in v0.3.0

func (crane *Crane) RemoteAddr() net.Addr

func (*Crane) Start

func (crane *Crane) Start() error

func (*Crane) Stop

func (crane *Crane) Stop(err *terminal.Error)

func (*Crane) String added in v0.3.0

func (crane *Crane) String() string

func (*Crane) Transport added in v0.3.7

func (crane *Crane) Transport() *hub.Transport

func (*Crane) VerifyConnectedHub added in v0.3.0

func (crane *Crane) VerifyConnectedHub() error

type CraneControllerTerminal added in v0.3.0

type CraneControllerTerminal struct {
	*terminal.TerminalBase
	*terminal.DuplexFlowQueue

	Crane *Crane
}

func NewLocalCraneControllerTerminal added in v0.3.0

func NewLocalCraneControllerTerminal(
	crane *Crane,
	initMsg *terminal.TerminalOpts,
) (*CraneControllerTerminal, *container.Container, *terminal.Error)

func NewRemoteCraneControllerTerminal added in v0.3.0

func NewRemoteCraneControllerTerminal(
	crane *Crane,
	initData *container.Container,
) (*CraneControllerTerminal, *terminal.TerminalOpts, *terminal.Error)

func (*CraneControllerTerminal) Abandon added in v0.3.0

func (controller *CraneControllerTerminal) Abandon(err *terminal.Error)

func (*CraneControllerTerminal) Deliver added in v0.3.0

func (controller *CraneControllerTerminal) Deliver(c *container.Container) *terminal.Error

type CraneTerminal added in v0.3.0

type CraneTerminal struct {
	*terminal.TerminalBase
	*terminal.DuplexFlowQueue
	// contains filtered or unexported fields
}

func NewLocalCraneTerminal added in v0.3.0

func NewLocalCraneTerminal(
	crane *Crane,
	remoteHub *hub.Hub,
	initMsg *terminal.TerminalOpts,
	submitUpstream func(*container.Container),
) (*CraneTerminal, *container.Container, *terminal.Error)

func NewRemoteCraneTerminal added in v0.3.0

func NewRemoteCraneTerminal(
	crane *Crane,
	id uint32,
	initData *container.Container,
) (*CraneTerminal, *terminal.TerminalOpts, *terminal.Error)

func (*CraneTerminal) Abandon added in v0.3.0

func (t *CraneTerminal) Abandon(err *terminal.Error)

func (*CraneTerminal) Deliver added in v0.3.0

func (*CraneTerminal) IsAbandoned added in v0.3.0

func (t *CraneTerminal) IsAbandoned() bool

func (*CraneTerminal) LocalAddr added in v0.3.0

func (t *CraneTerminal) LocalAddr() net.Addr

func (*CraneTerminal) RemoteAddr added in v0.3.0

func (t *CraneTerminal) RemoteAddr() net.Addr

func (*CraneTerminal) Transport added in v0.3.7

func (t *CraneTerminal) Transport() *hub.Transport

type ExpandOp added in v0.3.0

type ExpandOp struct {
	terminal.OpBase

	*terminal.DuplexFlowQueue
	// contains filtered or unexported fields
}

func (*ExpandOp) Abandon added in v0.3.0

func (op *ExpandOp) Abandon(err *terminal.Error)

func (*ExpandOp) Ctx added in v0.3.0

func (op *ExpandOp) Ctx() context.Context

func (*ExpandOp) End added in v0.3.0

func (op *ExpandOp) End(err *terminal.Error)

func (*ExpandOp) FmtID added in v0.3.0

func (op *ExpandOp) FmtID() string

func (*ExpandOp) Type added in v0.3.0

func (op *ExpandOp) Type() string

type ExpansionRelayTerminal added in v0.3.0

type ExpansionRelayTerminal struct {
	*terminal.DuplexFlowQueue
	// contains filtered or unexported fields
}

func (*ExpansionRelayTerminal) Abandon added in v0.3.0

func (t *ExpansionRelayTerminal) Abandon(err *terminal.Error)

func (*ExpansionRelayTerminal) Ctx added in v0.3.0

func (*ExpansionRelayTerminal) FmtID added in v0.3.0

func (t *ExpansionRelayTerminal) FmtID() string

func (*ExpansionRelayTerminal) ID added in v0.3.0

type ExpansionTerminal added in v0.3.0

type ExpansionTerminal struct {
	*terminal.TerminalBase
	*terminal.DuplexFlowQueue
	// contains filtered or unexported fields
}

func ExpandTo added in v0.3.0

func ExpandTo(t terminal.OpTerminal, routeTo string, encryptFor *hub.Hub) (*ExpansionTerminal, *terminal.Error)

func (*ExpansionTerminal) Abandon added in v0.3.0

func (t *ExpansionTerminal) Abandon(err *terminal.Error)

func (*ExpansionTerminal) Deliver added in v0.3.0

func (*ExpansionTerminal) End added in v0.3.0

func (t *ExpansionTerminal) End(err *terminal.Error)

func (*ExpansionTerminal) FmtID added in v0.3.0

func (t *ExpansionTerminal) FmtID() string

func (*ExpansionTerminal) HasEnded added in v0.3.0

func (t *ExpansionTerminal) HasEnded(end bool) bool

func (*ExpansionTerminal) ID added in v0.3.0

func (t *ExpansionTerminal) ID() uint32

func (*ExpansionTerminal) IsAbandoned added in v0.3.0

func (t *ExpansionTerminal) IsAbandoned() bool

func (*ExpansionTerminal) SetChangeNotifyFunc added in v0.3.7

func (t *ExpansionTerminal) SetChangeNotifyFunc(f func())

func (*ExpansionTerminal) SetID added in v0.3.0

func (t *ExpansionTerminal) SetID(id uint32)

func (*ExpansionTerminal) Type added in v0.3.0

func (t *ExpansionTerminal) Type() string

Jump to

Keyboard shortcuts

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