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

shellbar

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 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(config Config, closed <-chan struct{}, parentwg *sync.WaitGroup)

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 {
	Topic string `json:"topic"`

	CanRead bool `json:"canRead"`

	CanWrite bool `json:"canWrite"`

	Connected string `json:"connected"`

	RemoteAddr string `json:"remoteAddr"`

	UserAgent string `json:"userAgent"`

	Stats RxTx `json:"stats"`
}

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

type Config

type Config struct {

	// Listen is the listening port
	Listen int

	// Audience must match the host in token
	Audience string

	// Secret is used to validating statsTokens
	Secret string

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

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