Help us shape the future of Go! Take the 2026 Go Developer Survey

shellbar

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Shellbar

func Shellbar(closed <-chan struct{}, parentwg *sync.WaitGroup, config Config)

Shellbar runs ssh relay with the given configuration

Types

type Client

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

Client is a middleperson between the websocket connection and the hub.

type ClientReport

type ClientReport struct {
	CanRead bool `json:"can_read"`

	CanWrite bool `json:"can_write"`

	ConnectedAt string `json:"connected_at"`

	ExpiresAt string `json:"expires_at"`

	RemoteAddr string `json:"remote_address"`

	Stats RxTx `json:"statistics"`

	Topic string `json:"topic"`

	UserAgent string `json:"user_agent"`
}

ClientReport represents statistics on a client, and omits non-serialisable internal references

type Config

type Config struct {

	// Audience must match the host in token
	Audience string

	// BufferSize is the channel buffer size for clients
	BufferSize int64

	// ExchangeCode swaps a code for the associated Token
	CodeStore *ttlcode.CodeStore

	// Listen is the listening port
	Listen int

	// Secret is used to validating statsTokens
	Secret string

	//StatsEvery controls how often to send stats reports
	StatsEvery time.Duration
}

Config represents configuration of the relay & lets configuration be passed as argument to permit testing

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a pointer to a new, default, Config

func (*Config) WithAudience

func (c *Config) WithAudience(audience string) *Config

WithAudience sets the audience in the Config

func (*Config) WithCodeStoreTTL

func (c *Config) WithCodeStoreTTL(ttl int64) *Config

WithCodeStoreTTL sets the TTL of the codestore

func (*Config) WithListen

func (c *Config) WithListen(listen int) *Config

WithListen sets the listening port in the Config

type ConnectionAction

type ConnectionAction struct {
	Action string `json:"action"`
	URI    string `json:"uri"`
	UUID   string `json:"uuid"`
}

ConnectionAction represents an action happening on a connection

type ConnectionType

type ConnectionType int

ConnectionType represents whether the connection is for Session, Shell or Unsupported

const (
	Session ConnectionType = iota
	Shell
	Unsupported
)

Enumerated connection types

type Frames

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

Frames represents statistics for (video) frames

type Hub

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

Hub maintains the set of active clients and broadcasts messages to the clients.

type ReportStats

type ReportStats struct {
	Last string `json:"last"` //how many seconds ago...

	Size float64 `json:"size"`

	Fps float64 `json:"fps"`
}

ReportStats represents statistics to be reported on a connection

type RxTx

type RxTx struct {
	Tx ReportStats `json:"tx"`
	Rx ReportStats `json:"rx"`
}

RxTx represents statistics for both receive and transmit

type Stats

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

Stats represents statistics for (video) frames received and transmitted

type StatsCommand

type StatsCommand struct {
	Command string `json:"cmd"`
}

StatsCommand represents a command relating to collection of statistics

Jump to

Keyboard shortcuts

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