data_provider

package
v4.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataListener

type DataListener interface {
	Update(newData []byte) error
}

type DataManager

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

func NewDataManager

func NewDataManager() *DataManager

func (*DataManager) AddDataProvider

func (m *DataManager) AddDataProvider(name string, p *DataProvider)

func (*DataManager) GetDataProvider

func (m *DataManager) GetDataProvider(name string) *DataProvider

type DataProvider

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

func NewDataProvider

func NewDataProvider(lg *zap.Logger, cfg *DataProviderConfig) (*DataProvider, error)

func (*DataProvider) Close

func (ds *DataProvider) Close()

func (*DataProvider) GetData

func (ds *DataProvider) GetData() ([]byte, error)

func (*DataProvider) LoadAndAddListener

func (ds *DataProvider) LoadAndAddListener(l DataListener) error

LoadAndAddListener loads the DataListener, returns any error that occurs, and add this DataListener to this DataProvider.

type DataProviderConfig

type DataProviderConfig struct {
	Tag        string `yaml:"tag"`
	File       string `yaml:"file"`
	AutoReload bool   `yaml:"auto_reload"`
}

Jump to

Keyboard shortcuts

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