config

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ALPR added in v1.0.5

type ALPR struct {
	URL   string `yaml:"url"`
	Token string `yaml:"token"`
}

type AutoRia

type AutoRia struct {
	Period Duration `yaml:"period"`
	APIKey string   `yaml:"api_key"`
}

AutoRia represents configuration for the AutoRia API.

type Bot added in v1.0.1

type Bot struct {
	URL            string `yaml:"url"`
	Token          string `yaml:"token"`
	MaxConnections *int   `yaml:"max_connections"`
}

type Config

type Config struct {
	Log      Log      `yaml:"log"`
	Server   Server   `yaml:"server"`
	Database Database `yaml:"database"`
	GRPC     GRPC     `yaml:"grpc"`
	Bot      Bot      `yaml:"bot"`
	ALPR     ALPR     `yaml:"alpr"`
}

Config represents mix of settings for the app.

func New

func New(path string) (*Config, error)

New reads application configuration from specified file path.

type Database added in v1.0.1

type Database struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	User     string `yaml:"username"`
	Password string `yaml:"password"`
	Database string `yaml:"database"`
	SSLMode  string `yaml:"ssl_mode"`
}

Store represents configuration for the storage.

type Duration

type Duration struct {
	time.Duration
}

Duration represents custom type for unmarshaling string. For example: "500ms", "1s", "2m", etc.

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText implements yaml unmarshaler.

type GRPC added in v1.0.1

type GRPC struct {
	Vehicle ServiceGRPC `yaml:"vehicle"`
}

type Log added in v0.0.47

type Log struct {
	Level string `yaml:"level"`
	Mode  string `yaml:"mode"`
}

Log represents settings for application logger.

type Server added in v0.0.47

type Server struct {
	ShutdownTimeout Duration `yaml:"shutdown_timeout"`
	ReadTimeout     Duration `yaml:"read_timeout"`
	WriteTimeout    Duration `yaml:"write_timeout"`
	IdleTimeout     Duration `yaml:"idle_timeout"`
}

Server represents settings for creating http server.

type ServiceGRPC added in v1.0.1

type ServiceGRPC struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

func (*ServiceGRPC) Address added in v1.0.1

func (s *ServiceGRPC) Address() string

Jump to

Keyboard shortcuts

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