config

package
v0.0.0-...-dfdd2cf Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "jsch"
	EnvProd = "production"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	JWT                    JWTConfig
	PasswordSalt           string `envconfig:"auth_password_salt" required:"true"`
	VerificationCodeLength int    `envconfig:"auth_verification_code_length" required:"true"`
}

type Config

type Config struct {
	Env   string `required:"true"`
	Mongo MongoConfig
	HTTP  HTTPConfig
	Auth  AuthConfig
}

func Init

func Init() (*Config, error)

type HTTPConfig

type HTTPConfig struct {
	Host               string        `envconfig:"http_host"`
	Port               string        `ignored:"true" default:"8085"`
	ReadTimeout        time.Duration `envconfig:"http_read_timeout" default:"10s"`
	WriteTimeout       time.Duration `envconfig:"http_write_timeout" default:"10s"`
	MaxHeaderMegabytes int           `envconfig:"http_max_header_megabytes" default:"1"`
}

type JWTConfig

type JWTConfig struct {
	AccessTokenTTL  time.Duration `envconfig:"jwt_access_token_ttl" default:"2h"`
	RefreshTokenTTL time.Duration `envconfig:"jwt_refresh_token_ttl" default:"720h"`
	SigningKey      string        `envconfig:"jwt_signing_key" required:"true"`
}

type MongoConfig

type MongoConfig struct {
	URI      string `required:"true"`
	User     string `required:"true"`
	Password string `required:"true"`
	Database string `required:"true" default:"jobSchedule"`
}

Jump to

Keyboard shortcuts

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