config

package
v0.0.0-...-2771b56 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 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 Config

type Config struct {
	Mongo  Mongo  `yaml:"mongodb" validate:"required"`
	Server Server `yaml:"server" validate:"required"`
}

func NewConfig

func NewConfig(path, name string) (*Config, error)

type Mongo

type Mongo struct {
	Connection string `yaml:"url" validate:"required"`
	Database   string `yaml:"database" validate:"required"`
	Collection string `yaml:"collection" validate:"required"`
}

type Server

type Server struct {
	Port              string        `yaml:"port"`
	ReadTimeout       time.Duration `yaml:"read_timeout"`
	WriteTimeout      time.Duration `yaml:"write_timeout"`
	MaxWriteMegabytes int           `yaml:"max_write_megabytes"`
}

Jump to

Keyboard shortcuts

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