service

package
v0.0.0-...-c45527a Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{}

DefaultOptions is a quic service configuration that will be used if no options provided.

Functions

func ParseJSONOptions

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

ParseJSONOptions function fills in Quic options from JSON request

Types

type ConsumerConfig

type ConsumerConfig struct {
	URL string `json:"url"`
}

ConsumerConfig represents configuration for consumer.

type Manager

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

Manager represents an instance of Quic service

func NewManager

func NewManager(
	country string,
	eventBus eventbus.EventBus,
) *Manager

NewManager creates new instance of Quic service

func (*Manager) ProvideConfig

func (m *Manager) ProvideConfig(sessionID string, sessionConfig json.RawMessage, remoteConn p2p.ServiceConn) (*service.ConfigParams, error)

ProvideConfig provides the config for consumer and handles new Quic connection.

func (*Manager) Serve

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

Serve starts service - does block

func (*Manager) Stop

func (m *Manager) Stop() error

Stop stops service.

type Options

type Options struct{}

Options describes options which are required to start Quic service.

func GetOptions

func GetOptions() Options

GetOptions returns effective Quic service options from application configuration.

func (Options) MarshalJSON

func (o Options) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface to provide human readable configuration.

func (*Options) UnmarshalJSON

func (o *Options) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface to receive human readable configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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