mvc

package
v0.0.0-...-e5a7b82 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpdateNone = -1 * iota
	UpdateInstalling
	UpdateReady
	UpdateAvailable
)
View Source
const (
	ConnConnecting = iota
	ConnReconnecting
	ConnOnline
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnStatus

type ConnStatus int

type ConnectionContext

type ConnectionContext struct {
	Tunnel     Tunnel
	ClientAddr string
}

type Controller

type Controller interface {
	// how the model communicates that it has changed state
	Update(State)

	// instructs the controller to shut the app down
	Shutdown(message string)

	// PlayRequest instructs the model to play requests
	PlayRequest(tunnel Tunnel, payload []byte)

	// A channel of updates
	Updates() *util.Broadcast

	// returns the current state
	State() State

	// safe wrapper for running go-routines
	Go(fn func())

	// the address where the web inspection interface is running
	GetWebInspectAddr() string
}

type Model

type Model interface {
	Run()

	Shutdown()

	PlayRequest(tunnel Tunnel, payload []byte)
}

type State

type State interface {
	GetClientVersion() string
	GetServerVersion() string
	GetTunnels() []Tunnel
	GetProtocols() []proto.Protocol
	GetUpdateStatus() UpdateStatus
	GetConnStatus() ConnStatus
	GetConnectionMetrics() (metrics.Meter, metrics.Timer)
	GetBytesInMetrics() (metrics.Counter, metrics.Histogram)
	GetBytesOutMetrics() (metrics.Counter, metrics.Histogram)
	SetUpdateStatus(UpdateStatus)
}

type Tunnel

type Tunnel struct {
	PublicUrl string
	Protocol  proto.Protocol
	LocalAddr string
}

type UpdateStatus

type UpdateStatus int

type View

type View interface {
	Shutdown()
}

Jump to

Keyboard shortcuts

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