adapter

package
v0.0.0-...-3aef678 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMaxPingsOutstanding int = 3
View Source
var DefaultMaxReconnects int = -1
View Source
var DefaultPingInterval int64 = 10
View Source
var DefaultWorkerCount int = 128

Default settings

Functions

func StrToBytes

func StrToBytes(s string) []byte

Types

type Adapter

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

func NewAdapter

func NewAdapter(a app.App) *Adapter

func (*Adapter) Init

func (adapter *Adapter) Init() error

type Packet

type Packet struct {
	EventName string
	Payload   []byte
}

type Source

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

func NewSource

func NewSource(adapter *Adapter, name string, sourceInfo *SourceInfo) *Source

func (*Source) HandleRequest

func (source *Source) HandleRequest(packet *Packet)

func (*Source) Init

func (source *Source) Init() error

func (*Source) InitSubscription

func (source *Source) InitSubscription() error

type SourceConfig

type SourceConfig struct {
	Sources map[string]SourceInfo `json:"sources"`
}

type SourceInfo

type SourceInfo struct {
	Host                string `json:"host"`
	Port                int    `json:"port"`
	Channel             string `json:"channel"`
	WorkerCount         *int   `json:"worker_count",omitempty`
	PingInterval        *int64 `json:"ping_interval",omitempty`
	MaxPingsOutstanding *int   `json:"max_pings_outstanding",omitempty`
	MaxReconnects       *int   `json:"max_reconnects",omitempty`
}

type SourceManager

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

func NewSourceManager

func NewSourceManager(adapter *Adapter) *SourceManager

func (*SourceManager) Initialize

func (sm *SourceManager) Initialize() error

func (*SourceManager) LoadSourceConfig

func (sm *SourceManager) LoadSourceConfig(filename string) (*SourceConfig, error)

Jump to

Keyboard shortcuts

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