Documentation
¶
Index ¶
- Constants
- func CheckPublicKeys(trustedPubKeys ...[]byte) (func(ssh.PublicKey) bool, error)
- func FormatPubKey(key ssh.PublicKey) string
- func WebsocketDial(ctx context.Context, addr string) (net.Conn, error)
- func WebsocketUpgrade(conn io.ReadWriter) error
- type ClientType
- type Command
- type DB
- type ExecMeta
- type Hub
- type HubHeader
- type Logger
- type Master
- type MountDirMeta
- type Servant
- type ServantID
- type TunnelHeader
Constants ¶
View Source
const ( UnmarshalMetaFailed ssh.RejectionReason = iota + ssh.ResourceShortage + 1000 FailedStartPTY )
View Source
const DefaultSignTimeout = 10 * time.Second
View Source
const ExecResizeRequest = "resize"
Variables ¶
This section is empty.
Functions ¶
func CheckPublicKeys ¶ added in v0.2.0
func FormatPubKey ¶ added in v0.2.1
func WebsocketUpgrade ¶
func WebsocketUpgrade(conn io.ReadWriter) error
Types ¶
type ClientType ¶
type ClientType int
const ( ClientTypeServant ClientType = iota ClientTypeMaster )
type DB ¶
type DB interface { StoreLocation(id string, netAddr string) error LoadLocation(idPrefix string) (netAddr string, id string, err error) DeleteLocation(id string) error }
DB store the location of which hub node the servant is connected to.
type Hub ¶
type Hub struct { Logger *slog.Logger DB DB GetIP func() (string, error) // contains filtered or unexported fields }
func (*Hub) Handle ¶
func (h *Hub) Handle(conn io.ReadWriteCloser)
func (*Hub) MustStartRelay ¶ added in v0.2.3
func (h *Hub) MustStartRelay() func()
MustStartRelay is similar to Hub.StartRelay.
func (*Hub) StartRelay ¶ added in v0.2.3
type HubHeader ¶
type HubHeader struct { Type ClientType ID ServantID }
type MountDirMeta ¶
type Servant ¶
func NewServant ¶
func (*Servant) Serve ¶ added in v0.1.0
func (s *Servant) Serve(conn io.ReadWriteCloser) func()
Click to show internal directories.
Click to hide internal directories.