Documentation ¶
Index ¶
- Constants
- Variables
- func AssignCrane(hubID string, crane *Crane)
- func GetAllAssignedCranes() map[string]*Crane
- func ImportAndVerifyHubInfo(ctx context.Context, hubID string, announcementData, statusData []byte, ...) (h *hub.Hub, forward bool, tErr *terminal.Error)
- func MeasureHub(ctx context.Context, h *hub.Hub, checkExpiryWith time.Duration) *terminal.Error
- func RegisterCraneUpdateHook(fn func(crane *Crane))
- type BlockingSubmitQueue
- type BlockingSubmitter
- type CapacityTestOp
- type CapacityTestOptions
- type Crane
- func (crane *Crane) AbandonTerminal(id uint32, err *terminal.Error)
- func (crane *Crane) Authenticated() bool
- func (crane *Crane) EstablishNewTerminal(localTerm terminal.TerminalInterface, initData *container.Container) *terminal.Error
- func (crane *Crane) IsMine() bool
- func (crane *Crane) LocalAddr() net.Addr
- func (crane *Crane) NotifyUpdate()
- func (crane *Crane) Public() bool
- func (crane *Crane) Publish() error
- func (crane *Crane) RemoteAddr() net.Addr
- func (crane *Crane) Start() error
- func (crane *Crane) Stop(err *terminal.Error)
- func (crane *Crane) Stopped() bool
- func (crane *Crane) String() string
- func (crane *Crane) Transport() *hub.Transport
- func (crane *Crane) VerifyConnectedHub() error
- type CraneControllerTerminal
- type CraneTerminal
- func (t *CraneTerminal) Abandon(err *terminal.Error)
- func (t *CraneTerminal) Deliver(c *container.Container) *terminal.Error
- func (t *CraneTerminal) Flush()
- func (t *CraneTerminal) GrantPermission(grant terminal.Permission)
- func (t *CraneTerminal) IsAbandoned() bool
- func (t *CraneTerminal) LocalAddr() net.Addr
- func (t *CraneTerminal) RemoteAddr() net.Addr
- func (t *CraneTerminal) Transport() *hub.Transport
- type ExpandOp
- type ExpansionRelayTerminal
- type ExpansionTerminal
- func (t *ExpansionTerminal) Abandon(err *terminal.Error)
- func (t *ExpansionTerminal) Deliver(c *container.Container) *terminal.Error
- func (t *ExpansionTerminal) End(err *terminal.Error)
- func (t *ExpansionTerminal) Flush()
- func (t *ExpansionTerminal) FmtID() string
- func (t *ExpansionTerminal) HasEnded(end bool) bool
- func (t *ExpansionTerminal) ID() uint32
- func (t *ExpansionTerminal) IsAbandoned() bool
- func (t *ExpansionTerminal) SetChangeNotifyFunc(f func())
- func (t *ExpansionTerminal) SetID(id uint32)
- func (t *ExpansionTerminal) Type() string
- type LatencyTestClientOp
- type LatencyTestOp
- type NetworkOptimizationState
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"
)
Variables ¶
View Source
var (
ErrDone = errors.New("crane is done")
)
Errors.
Functions ¶
func AssignCrane ¶
func GetAllAssignedCranes ¶ added in v0.3.5
func ImportAndVerifyHubInfo ¶ added in v0.3.0
func MeasureHub ¶ added in v0.3.13
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
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 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 (*Crane) AbandonTerminal ¶ added in v0.3.0
func (*Crane) Authenticated ¶ added in v0.3.13
func (*Crane) EstablishNewTerminal ¶ added in v0.3.0
func (*Crane) NotifyUpdate ¶ added in v0.3.0
func (crane *Crane) NotifyUpdate()
NotifyUpdate calls the registers crane update hook function.
func (*Crane) RemoteAddr ¶ added in v0.3.0
func (*Crane) VerifyConnectedHub ¶ added in v0.3.0
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 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 (t *CraneTerminal) Deliver(c *container.Container) *terminal.Error
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 }
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 (t *ExpansionRelayTerminal) Ctx() context.Context
func (*ExpansionRelayTerminal) FmtID ¶ added in v0.3.0
func (t *ExpansionRelayTerminal) FmtID() string
func (*ExpansionRelayTerminal) ID ¶ added in v0.3.0
func (t *ExpansionRelayTerminal) ID() uint32
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 (t *ExpansionTerminal) Deliver(c *container.Container) *terminal.Error
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 (op *LatencyTestClientOp) Deliver(c *container.Container) *terminal.Error
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
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
func (*NetworkOptimizationState) LastSuggestedAt ¶ added in v0.3.13
func (netState *NetworkOptimizationState) LastSuggestedAt() time.Time
func (*NetworkOptimizationState) UpdateLastSuggestedAt ¶ added in v0.3.13
func (netState *NetworkOptimizationState) UpdateLastSuggestedAt()
Click to show internal directories.
Click to hide internal directories.