adapter

package
v0.0.0-...-a161781 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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) Init

func (source *Source) Init() error

func (*Source) InitStateStore

func (source *Source) InitStateStore() error

func (*Source) Run

func (source *Source) Run() error

type SourceConfig

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

type SourceEntry

type SourceEntry struct {
	SubscriberID        string       `json:"subscriber_id"`
	SubscriberName      string       `json:"subscriber_name"`
	Host                string       `json:"host"`
	Port                int          `json:"port"`
	WorkerCount         *int         `json:"worker_count",omitempty`
	ChunkSize           *int         `json:"chunk_size",omitempty`
	PingInterval        *int64       `json:"ping_interval",omitempty`
	MaxPingsOutstanding *int         `json:"max_pings_outstanding",omitempty`
	MaxReconnects       *int         `json:"max_reconnects",omitempty`
	Collections         *[]string    `json:"collections"`
	Verbose             *bool        `json:"verbose",omitempty`
	InitialLoad         *bool        `json:"initial_load", omitempty`
	OmittedCount        *uint64      `json:"omitted_count", omitempty`
	Events              SourceEvents `json:"events"`
}

type SourceEvents

type SourceEvents struct {
	Snapshot string `json:"snapshot"`
	Create   string `json:"create"`
	Update   string `json:"update"`
	Delete   string `json:"delete"`
}

type SourceInfo

type SourceInfo struct {
	SubscriberID        string
	SubscriberName      string
	Host                string
	Port                int
	WorkerCount         int
	ChunkSize           int
	PingInterval        int64
	MaxPingsOutstanding int
	MaxReconnects       int
	Collections         []string
	Verbose             bool
	InitialLoad         bool
	OmittedCount        uint64
	Events              SourceEvents
}

func NewSourceInfo

func NewSourceInfo(entry *SourceEntry) *SourceInfo

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