noop

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceType = "noop"

ServiceType indicates "noop" service type

Variables

View Source
var ErrAlreadyStarted = errors.New("service already started")

ErrAlreadyStarted is the error we return when the start is called multiple times

Functions

func Bootstrap

func Bootstrap()

Bootstrap is called on program initialization time and registers various deserializers related to noop service

func GetOptions

func GetOptions() service.Options

GetOptions returns effective Noop service options from application configuration.

func NewConnection

func NewConnection() (connection.Connection, error)

NewConnection creates a new noop connnection

func ParseJSONOptions

func ParseJSONOptions(_ *json.RawMessage) (service.Options, error)

ParseJSONOptions function fills in Noop options from JSON request

Types

type Connection

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

Connection which does no real tunneling

func (*Connection) GetConfig

func (c *Connection) GetConfig() (connection.ConsumerConfig, error)

GetConfig returns the consumer configuration for session creation

func (*Connection) Reconnect

func (c *Connection) Reconnect(ctx context.Context, options connection.ConnectOptions) error

Reconnect restarts a connection with a new options.

func (*Connection) Start

func (c *Connection) Start(ctx context.Context, params connection.ConnectOptions) error

Start implements the connection.Connection interface

func (*Connection) State

func (c *Connection) State() <-chan connectionstate.State

State returns connection state channel.

func (*Connection) Statistics

func (c *Connection) Statistics() (connectionstate.Statistics, error)

Statistics returns connection statistics channel.

func (*Connection) Stop

func (c *Connection) Stop()

Stop implements the connection.Connection interface

type Manager

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

Manager represents entrypoint for Noop service

func NewManager

func NewManager() *Manager

NewManager creates new instance of Noop service

func (*Manager) ProvideConfig

func (manager *Manager) ProvideConfig(_ string, _ json.RawMessage, _ *net.UDPConn) (*service.ConfigParams, error)

ProvideConfig provides the session configuration

func (*Manager) Serve

func (manager *Manager) Serve(instance *service.Instance) error

Serve starts service - does block

func (*Manager) Stop

func (manager *Manager) Stop() error

Stop stops service

Jump to

Keyboard shortcuts

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