docks

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: AGPL-3.0 Imports: 27 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

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"

	CraneMeasurementTTL = 1 * time.Hour
)
View Source
const (
	CraneMsgTypeEnd              = 0
	CraneMsgTypeInfo             = 1
	CraneMsgTypeRequestHubInfo   = 2
	CraneMsgTypeVerify           = 3
	CraneMsgTypeStartEncrypted   = 4
	CraneMsgTypeStartUnencrypted = 5
)
View Source
const (
	CapacityTestOpType = "capacity"
)
View Source
const ExpandOpType string = "expand"
View Source
const (
	LatencyTestOpType = "latency"
)
View Source
const NetStatePeriodInterval = 15 * time.Hour

Variables

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 MeasureHub added in v0.3.13

func MeasureHub(ctx context.Context, h *hub.Hub, checkExpiryWith time.Duration) *terminal.Error

MeasureHub measures the connection to this Hub and saves the results to the Hub.

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 CapacityTestOp added in v0.3.11

type CapacityTestOp struct {
	terminal.OpBase
	// contains filtered or unexported fields
}

func NewCapacityTestOp added in v0.3.11

func NewCapacityTestOp(t terminal.OpTerminal, opts *CapacityTestOptions) (*CapacityTestOp, *terminal.Error)

func (*CapacityTestOp) Deliver added in v0.3.11

func (op *CapacityTestOp) Deliver(c *container.Container) *terminal.Error

func (*CapacityTestOp) End added in v0.3.11

func (op *CapacityTestOp) End(tErr *terminal.Error)

func (*CapacityTestOp) Result added in v0.3.11

func (op *CapacityTestOp) Result() <-chan *terminal.Error

func (*CapacityTestOp) Type added in v0.3.11

func (op *CapacityTestOp) Type() string

type CapacityTestOptions added in v0.3.11

type CapacityTestOptions struct {
	TestVolume int
	MaxTime    time.Duration
	// contains filtered or unexported fields
}

type Crane

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

	// stopping indicates if the Crane will be stopped soon. The Crane may still
	// be used until stopped, but must not be advertised anymore.
	Stopping *abool.AtomicBool

	// ConnectedHub is the identity of the remote Hub.
	ConnectedHub *hub.Hub
	// NetState holds the network optimization state.
	// It must always be set and the reference must not be changed.
	// Access to fields within are coordinated by itself.
	NetState *NetworkOptimizationState

	// 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) Authenticated added in v0.3.13

func (crane *Crane) Authenticated() bool

func (*Crane) EstablishNewTerminal added in v0.3.0

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

func (*Crane) IsMine added in v0.3.13

func (crane *Crane) IsMine() bool

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) Stopped added in v0.3.11

func (crane *Crane) Stopped() bool

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

func (*CraneControllerTerminal) Flush added in v0.3.11

func (controller *CraneControllerTerminal) Flush()

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) Flush added in v0.3.11

func (t *CraneTerminal) Flush()

func (*CraneTerminal) GrantPermission added in v0.3.13

func (t *CraneTerminal) GrantPermission(grant terminal.Permission)

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) Flush added in v0.3.11

func (t *ExpansionTerminal) Flush()

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

type LatencyTestClientOp added in v0.3.11

type LatencyTestClientOp struct {
	LatencyTestOp
	// contains filtered or unexported fields
}

func NewLatencyTestOp added in v0.3.11

func NewLatencyTestOp(t terminal.OpTerminal) (*LatencyTestClientOp, *terminal.Error)

func (*LatencyTestClientOp) Deliver added in v0.3.11

func (*LatencyTestClientOp) End added in v0.3.11

func (op *LatencyTestClientOp) End(tErr *terminal.Error)

func (*LatencyTestClientOp) Result added in v0.3.11

func (op *LatencyTestClientOp) Result() <-chan *terminal.Error

type LatencyTestOp added in v0.3.11

type LatencyTestOp struct {
	terminal.OpBase
	// contains filtered or unexported fields
}

func (*LatencyTestOp) Deliver added in v0.3.11

func (op *LatencyTestOp) Deliver(c *container.Container) *terminal.Error

func (*LatencyTestOp) End added in v0.3.11

func (op *LatencyTestOp) End(tErr *terminal.Error)

func (*LatencyTestOp) Type added in v0.3.11

func (op *LatencyTestOp) Type() string

type NetworkOptimizationState added in v0.3.13

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

func (*NetworkOptimizationState) GetTrafficStats added in v0.3.14

func (netState *NetworkOptimizationState) GetTrafficStats() (
	lifetimeBytesIn uint64,
	lifetimeBytesOut uint64,
	lifetimeStarted time.Time,
	periodBytesIn uint64,
	periodBytesOut uint64,
	periodStarted time.Time,
)

func (*NetworkOptimizationState) LapsePeriod added in v0.3.14

func (netState *NetworkOptimizationState) LapsePeriod()

func (*NetworkOptimizationState) LastSuggestedAt added in v0.3.13

func (netState *NetworkOptimizationState) LastSuggestedAt() time.Time

func (*NetworkOptimizationState) ReportTraffic added in v0.3.14

func (netState *NetworkOptimizationState) ReportTraffic(bytes uint64, in bool)

func (*NetworkOptimizationState) UpdateLastSuggestedAt added in v0.3.13

func (netState *NetworkOptimizationState) UpdateLastSuggestedAt()

Jump to

Keyboard shortcuts

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