Documentation ¶
Index ¶
- Constants
- Variables
- type Action
- type Bus
- func (b *Bus) PublishCreateConnection(ctx context.Context, conn *opts.ConnectionOptions) error
- func (b *Bus) PublishCreateRelay(ctx context.Context, relay *opts.RelayOptions) error
- func (b *Bus) PublishCreateTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error
- func (b *Bus) PublishDeleteConnection(ctx context.Context, conn *opts.ConnectionOptions) error
- func (b *Bus) PublishDeleteRelay(ctx context.Context, relay *opts.RelayOptions) error
- func (b *Bus) PublishDeleteTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error
- func (b *Bus) PublishResumeRelay(ctx context.Context, relay *opts.RelayOptions) error
- func (b *Bus) PublishResumeTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error
- func (b *Bus) PublishStopRelay(ctx context.Context, relay *opts.RelayOptions) error
- func (b *Bus) PublishStopTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error
- func (b *Bus) PublishUpdateConnection(ctx context.Context, conn *opts.ConnectionOptions) error
- func (b *Bus) PublishUpdateRelay(ctx context.Context, relay *opts.RelayOptions) error
- func (b *Bus) PublishUpdateTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error
- func (b *Bus) Start(serviceCtx context.Context) error
- func (b *Bus) Stop() error
- type Config
- type IBus
- type Message
- type NoOpBus
- func (n NoOpBus) PublishCreateConnection(_ context.Context, _ *opts.ConnectionOptions) error
- func (n NoOpBus) PublishCreateRelay(_ context.Context, _ *opts.RelayOptions) error
- func (n NoOpBus) PublishCreateTunnel(_ context.Context, _ *opts.TunnelOptions) error
- func (n NoOpBus) PublishDeleteConnection(_ context.Context, _ *opts.ConnectionOptions) error
- func (n NoOpBus) PublishDeleteRelay(_ context.Context, _ *opts.RelayOptions) error
- func (n NoOpBus) PublishDeleteTunnel(_ context.Context, _ *opts.TunnelOptions) error
- func (n NoOpBus) PublishResumeRelay(_ context.Context, _ *opts.RelayOptions) error
- func (n NoOpBus) PublishResumeTunnel(_ context.Context, _ *opts.TunnelOptions) error
- func (n NoOpBus) PublishStopRelay(_ context.Context, _ *opts.RelayOptions) error
- func (n NoOpBus) PublishStopTunnel(_ context.Context, _ *opts.TunnelOptions) error
- func (n NoOpBus) PublishUpdateConnection(_ context.Context, _ *opts.ConnectionOptions) error
- func (n NoOpBus) PublishUpdateRelay(_ context.Context, _ *opts.RelayOptions) error
- func (n NoOpBus) PublishUpdateTunnel(_ context.Context, _ *opts.TunnelOptions) error
- func (n NoOpBus) Start(_ context.Context) error
- func (n NoOpBus) Stop() error
Constants ¶
const ( StreamName = "events" BroadcastSubject = "broadcast" QueueSubject = "queue" )
const ( CreateConnection = "CreateConnection" UpdateConnection = "UpdateConnection" DeleteConnection = "DeleteConnection" CreateRelay = "CreateRelay" UpdateRelay = "UpdateRelay" DeleteRelay = "DeleteRelay" StopRelay = "StopRelay" ResumeRelay = "ResumeRelay" CreateTunnel = "CreateTunnel" UpdateTunnel = "UpdateTunnel" DeleteTunnel = "DeleteTunnel" StopTunnel = "StopTunnel" ResumeTunnel = "ResumeTunnel" UpdateConfig = "UpdateConfig" )
Variables ¶
var ( ConsumersNotRunning = errors.New("nothing to stop - consumers not running") ConsumersAlreadyRunning = errors.New("cannot start - consumers already running") )
var ( ValidActions = []Action{ CreateConnection, UpdateConnection, DeleteConnection, CreateRelay, UpdateRelay, DeleteRelay, StopRelay, ResumeRelay, CreateTunnel, UpdateTunnel, DeleteTunnel, StopTunnel, ResumeTunnel, UpdateConfig, } )
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
func (*Bus) PublishCreateConnection ¶
PublishCreateConnection publishes a CreateConnection message, which other plumber instances will receive and add the connection to their local in-memory maps
func (*Bus) PublishCreateRelay ¶
PublishCreateRelay publishes a CreateRelay message, which other plumber instances will receive and add the service to their local in-memory maps
func (*Bus) PublishCreateTunnel ¶ added in v1.4.0
PublishCreateTunnel publishes a CreateTunnel message, which other plumber instances will receive and add the service to their local in-memory maps
func (*Bus) PublishDeleteConnection ¶
PublishDeleteConnection publishes a DeleteConnection message, which other plumber instances will receive and delete from their local in-memory maps
func (*Bus) PublishDeleteRelay ¶
PublishDeleteRelay publishes a DeleteRelay message, which other plumber instances will receive and delete from their local in-memory maps
func (*Bus) PublishDeleteTunnel ¶ added in v1.4.0
PublishDeleteTunnel publishes a DeleteTunnel message, which other plumber instances will receive and delete from their local in-memory maps
func (*Bus) PublishResumeRelay ¶
PublishResumeRelay broadcasts a ResumeRelay message which will cause all plumber instances to start a stopped relay and add it to their in-memory cache.
func (*Bus) PublishResumeTunnel ¶ added in v1.4.0
PublishResumeTunnel broadcasts a ResumeTunnel message which will cause all plumber instances to start a stopped relay and add it to their in-memory cache.
func (*Bus) PublishStopRelay ¶
PublishStopRelay broadcasts a StopRelay message which will cause all plumber instances to stop the relay and remove it from their in-memory cache.
func (*Bus) PublishStopTunnel ¶ added in v1.4.0
PublishStopTunnel broadcasts a StopTunnel message which will cause all plumber instances to stop the relay and remove it from their in-memory cache.
func (*Bus) PublishUpdateConnection ¶
PublishUpdateConnection publishes an UpdateConnection message, which other plumber instances will receive and update the connection in their local in-memory maps
func (*Bus) PublishUpdateRelay ¶
PublishUpdateRelay publishes an UpdateRelay message, which other plumber instances will receive and update the connection in their local in-memory maps
func (*Bus) PublishUpdateTunnel ¶ added in v1.4.0
PublishUpdateTunnel publishes an UpdateTunnel message, which other plumber instances will receive and update the connection in their local in-memory maps
type IBus ¶
type IBus interface { // Start starts up the broadcast and queue consumers Start(serviceCtx context.Context) error // Stop stops the broadcast and queue consumers Stop() error PublishCreateConnection(ctx context.Context, conn *opts.ConnectionOptions) error PublishUpdateConnection(ctx context.Context, conn *opts.ConnectionOptions) error PublishDeleteConnection(ctx context.Context, conn *opts.ConnectionOptions) error PublishCreateRelay(ctx context.Context, relay *opts.RelayOptions) error PublishUpdateRelay(ctx context.Context, relay *opts.RelayOptions) error PublishDeleteRelay(ctx context.Context, relay *opts.RelayOptions) error PublishStopRelay(ctx context.Context, relay *opts.RelayOptions) error PublishResumeRelay(ctx context.Context, relay *opts.RelayOptions) error PublishCreateTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error PublishUpdateTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error PublishStopTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error PublishResumeTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error PublishDeleteTunnel(ctx context.Context, tunnelOptions *opts.TunnelOptions) error }
type Message ¶
type NoOpBus ¶
type NoOpBus struct{}
NoOpBus is a bus that does nothing