server

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(conf Config, assets *embed.FS, logsStorage tracer.Storage) (*http.Router, error)

Types

type Config

type Config struct {
	GitHash   string `yaml:"-"`
	BuildDate string `yaml:"-"`

	Release bool `yaml:"release"`

	ListenPort uint16        `yaml:"listen_port"`
	MongoDB    MongoDBConfig `yaml:"mongo_db"`

	Services map[string]ServiceConfig `yaml:"services"`
}

func LoadConfig

func LoadConfig(gitHash, buildDate string) Config

type Exporters

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

func StartExporters

func StartExporters(ctx context.Context, conf Config, logsStorage tracer.Storage) *Exporters

func (*Exporters) Stop

func (ex *Exporters) Stop()

type MongoDB

type MongoDB struct {
	*mongo.Database
}

func ConnectToMongoDB

func ConnectToMongoDB(ctx context.Context, conf MongoDBConfig) (*MongoDB, error)

func (*MongoDB) Close

func (db *MongoDB) Close(ctx context.Context) error

type MongoDBConfig

type MongoDBConfig struct {
	Address  string `yaml:"address"`
	Database string `yaml:"database"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type ServiceConfig

type ServiceConfig struct {
	Exporter ServiceExporterConfig `yaml:"exporter"`
}

type ServiceExporterConfig

type ServiceExporterConfig struct {
	URL     string        `yaml:"url"`
	Secret  string        `yaml:"secret"`
	Refresh time.Duration `yaml:"refresh"`
	Timeout time.Duration `yaml:"timeout"`
}

Jump to

Keyboard shortcuts

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