config

package
v0.0.0-...-ffb6f1e Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	DSN                  string `json:"dsn" validate:"min=1"`
	MaxConnections       uint8  `json:"max_conns" validate:"min=1"`
	MaxIdlingConnections uint8  `json:"max_idle_conns" validate:"min=1"`
	ConnectionTTL        uint32 `json:"conns_ttl" validate:""`
	MaxPacket            uint32 `json:"max_packet" validate:"min=1"`
}

Database data

type Metrics

type Metrics struct {
	Port      uint16 `json:"port" validate:"min=1"`
	Namespace string `json:"namespace" validate:"min=1"`
	Subsystem string `json:"subsystem" validate:"min=1"`
}

Metrics data

type Proxy

type Proxy struct {
	Port                  uint16   `json:"port" validate:"min=1"`
	Rest                  []string `json:"rest" validate:"gt=0,dive,listen_path"`
	MaxHeader             uint32   `json:"max_header" validate:"min=1"`
	MaxBody               uint32   `json:"max_body" validate:"min=1"`
	TimeoutReadHeader     uint32   `json:"timeout_read_header" validate:"min=1"`
	TimeoutRead           uint32   `json:"timeout_read" validate:"min=1"`
	TimeoutWrite          uint32   `json:"timeout_write" validate:"min=1"`
	StaleTransactionAfter uint32   `json:"stale_transaction_after" validate:"min=1"`
}

Proxy data

type RPC

type RPC struct {
	Nodes       []string `json:"nodes" validate:"min=1,dive,ip4_addr_port"`
	TimeoutConn uint32   `json:"timeout_conn" validate:"min=1"`
	TimeoutRecv uint32   `json:"timeout_recv" validate:"min=1"`
	TimeoutSend uint32   `json:"timeout_send" validate:"min=1"`
	Concurrency uint16   `json:"concurrency" validate:"min=1"`
}

RPC data

type Root

type Root struct {
	Log           string   `json:"log"`
	DatabaseRead  Database `json:"database_read" validate:"required"`
	DatabaseWrite Database `json:"database_write" validate:"required"`
	Proxy         Proxy    `json:"proxy" validate:"required"`
	RPC           RPC      `json:"rpc" validate:"required"`
	Metrics       Metrics  `json:"metrics" validate:"required"`
}

Root data

func New

func New() *Root

New default config

func (*Root) Load

func (r *Root) Load(path string) error

Load and fill config from file

Jump to

Keyboard shortcuts

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