Documentation
¶
Overview ¶
Package api implements api for pomerium desktop UI
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigProvider ¶
type ConfigProvider interface {
// Load returns configuration data,
// should not throw an error if underlying storage does not exist
Load() ([]byte, error)
// Save stores data into storage
Save([]byte) error
}
ConfigProvider provides interface to the configuration persistence
type EventBroadcaster ¶
type EventBroadcaster interface {
// Reset the history for the connection, called when listener starts accepting new connections
Reset(ctx context.Context, id string) error
// Update provides a peer connection state change updates
Update(ctx context.Context, evt *pb.ConnectionStatusUpdate) error
// Subscribe to updates for the tunnel; the channel will close when context provided is canceled
Subscribe(ctx context.Context, id string) (chan *pb.ConnectionStatusUpdate, error)
}
EventBroadcaster is used to record and broadcast tunnel and connection state changes
func NewEventsBroadcaster ¶
func NewEventsBroadcaster(ctx context.Context) EventBroadcaster
NewEventsBroadcaster creates a new broadcaster
type FileConfigProvider ¶
type FileConfigProvider string
FileConfigProvider implements file based configuration storage
func (FileConfigProvider) Load ¶
func (f FileConfigProvider) Load() ([]byte, error)
Load loads file data or returns empty data if it does not exist
func (FileConfigProvider) Save ¶
func (f FileConfigProvider) Save(data []byte) error
Save stores data to the file
type ListenerStatus ¶
type ListenerStatus interface {
// Lock marks a particular ID locked and provides a function to be called on unlock
SetListening(id string, onUnlock context.CancelFunc, addr string) error
// IsListening checks whether particular ID is currently locked
GetListenerStatus(id string) *pb.ListenerStatus
// Unlock unlocks the ID and calls onUnlock function and clears listener status
SetNotListening(id string) error
// SetListenError sets listener status to an error
SetListenerError(id string, err error) error
}
ListenerStatus marks individual records as locked
type MemCP ¶
type MemCP struct {
// contains filtered or unexported fields
}
MemCP is in-memory config provider
type Server ¶
type Server interface {
pb.ConfigServer
pb.ListenerServer
}
Server implements both config and listener interfaces
type ServerOption ¶
type ServerOption func(*server) error
ServerOption allows to customize certain behavior
func WithBrowserCommand ¶
func WithBrowserCommand(cmd string) ServerOption
func WithConfigProvider ¶
func WithConfigProvider(cp ConfigProvider) ServerOption
WithConfigProvider customizes configuration persistence
func WithServiceAccount ¶
func WithServiceAccount(serviceAccount string) ServerOption
func WithServiceAccountFile ¶
func WithServiceAccountFile(serviceAccountFile string) ServerOption
type Tunnel ¶
type Tunnel interface {
Run(context.Context, io.ReadWriter, tcptunnel.TunnelEvents) error
}
Tunnel is abstraction over tcptunnel.Tunnel to allow mocking