server

package
v0.0.0-...-d67b91f Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 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 App

type App struct {
	Name    string `env-required:"true" yaml:"name"    env:"APP_NAME"`
	Version string `env-required:"true" yaml:"version" env:"APP_VERSION"`
}

App -.

type Cache

type Cache struct {
	DefaultExpiration int `yaml:"default_expiration" env:"DEFAULT_EXPIRATION"`
	CleanupInterval   int `yaml:"cleanup_interval" env:"CLEANUP_INTERVAL"`
}

type Config

type Config struct {
	App          `yaml:"app"`
	HTTP         `yaml:"http"`
	Log          `yaml:"logger"`
	PG           `yaml:"postgres"`
	Secutiry     `yaml:"security"`
	Cache        `yaml:"cache"`
	FilesStorage `yaml:"files_storage"`
}

Config -.

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns app config.

type FilesStorage

type FilesStorage struct {
	Location string `yaml:"location" env:"FILES_LOCATION"`
}

type HTTP

type HTTP struct {
	Port string `env-required:"true" yaml:"port" env:"HTTP_PORT"`
}

HTTP -.

type Log

type Log struct {
	Level string `env-required:"true" yaml:"log_level"   env:"LOG_LEVEL"`
}

Log -.

type PG

type PG struct {
	PoolMax int    `env-required:"true" yaml:"pool_max" env:"PG_POOL_MAX"`
	URL     string `env-required:"true" yaml:"pg_url" env:"PG_URL"`
}

PG -.

type Secutiry

type Secutiry struct {
	AccessTokenPrivateKey  string        `yaml:"access_token_private_key" env:"ACCESS_TOKEN_PRIVATE_KEY"`
	AccessTokenPublicKey   string        `yaml:"access_token_public_key" env:"ACCESS_TOKEN_PUBLIC_KEY"`
	RefreshTokenPrivateKey string        `yaml:"refresh_token_private_key" env:"REFRESH_TOKEN_PRIVATE_KEY"`
	RefreshTokenPublicKey  string        `yaml:"refresh_token_public_key" env:"REFRESH_TOKEN_PUBLIC_KEY"`
	AccessTokenExpiresIn   time.Duration `yaml:"access_token_expired_in" env:"ACCESS_TOKEN_EXPIRED_IN"`
	RefreshTokenExpiresIn  time.Duration `yaml:"refresh_token_expired_in" env:"REFRESH_TOKEN_EXPIRED_IN"`
	AccessTokenMaxAge      int           `yaml:"access_token_maxage" env:"ACCESS_TOKEN_MAXAGE"`
	RefreshTokenMaxAge     int           `yaml:"refresh_token_maxage" env:"REFRESH_TOKEN_MAXAGE"`
	Domain                 string        `yaml:"domain" env:"DOMAIN"`
}

Jump to

Keyboard shortcuts

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