observer

package
v0.0.0-...-020e20f Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrStopped defines error on observer service has already stopped
	ErrStopped = errors.New("observer service has stopped")
	// ErrNotFound defines error on fail to found specified resource
	ErrNotFound = errors.New("resource not found")
	// ErrInconsistentData represents corrupted observation data.
	ErrInconsistentData = errors.New("inconsistent data")
)

Functions

func StopObserver

func StopObserver(service *Service, httpServer *http.Server) (err error)

StopObserver stops the service and http API server returned by StartObserver.

Types

type Config

type Config struct {
	Databases []Database `yaml:"Databases"`
}

Config defines subscription settings for observer.

type Database

type Database struct {
	ID       string `yaml:"ID"`
	Position string `yaml:"Position"`
}

Database defines single database subscription status.

type Service

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

Service defines the observer service structure.

func NewService

func NewService() (service *Service, err error)

NewService creates new observer service and load previous subscription from the meta database.

func StartObserver

func StartObserver(listenAddr string, version string) (service *Service, httpServer *http.Server, err error)

StartObserver starts the observer service and http API server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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