config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	Name              string        `default:"go8_api"`
	Host              string        `default:"0.0.0.0"`
	Port              string        `default:"3080"`
	ReadHeaderTimeout time.Duration `split_words:"true" default:"60s"`
	GracefulTimeout   time.Duration `split_words:"true" default:"8s"`
}

func API

func API() Api

type Cache

type Cache struct {
	Enable    bool   `default:"false"`
	Host      string `default:"0.0.0.0"`
	Port      string `default:"6379"`
	Hosts     []string
	Name      int `default:"1"`
	User      string
	Pass      string
	CacheTime time.Duration `split_words:"true" default:"5m"`
}

func NewCache

func NewCache() Cache

type Config

type Config struct {
	Api
	Cache
	Cors
	Rates
}

func New

func New(logger *slog.Logger) *Config

type Cors

type Cors struct {
	AllowedOrigins      []string `split_words:"true"`
	AllowCredentials    bool     `split_words:"true" default:"true"`
	AllowPrivateNetwork bool     `split_words:"true" default:"false"`
}

func NewCors

func NewCors() Cors

type Rates

type Rates struct {
	JobID    string        `split_words:"true" default:"fetch.exchange-rates"`
	Enabled  bool          `split_words:"true" default:"true"`
	Start    string        `split_words:"true"`
	Delay    time.Duration `split_words:"true" default:"24h"`
	Endpoint string
	Key      string
}

func NewRates

func NewRates() Rates

Jump to

Keyboard shortcuts

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