config

package
v0.0.0-...-00b5140 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 14 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 {
	Port    int `config:"api_port"`
	TimeOut float64
}

type Auth

type Auth struct {
	GoogleAPI OAuthConfig
	Classic   OAuthConfig
}

type BlockchainAPI

type BlockchainAPI struct {
	MaxSizeCall int     `config:"blockchainapi_maxcallsize"`
	URL         string  `config:"blockchainapi_url"`
	TimeOut     float64 `config:"blockchainapi_timeout"`
}

type Config

type Config struct {
	Name          string `config:"name" yaml:"name"`
	Version       string `config:"version"`
	DumpVar       bool   `config:"dump_var"`
	Domain        string `config:"domain"`
	TemplatesDir  string `config:"template_dir" yaml:"template_dir"`
	StaticDir     string `config:"static_dir" yaml:"static_dir"`
	Port          int    `config:"port"`
	Log           config.Log
	Api           Api
	Auth          Auth
	Metrics       Metrics
	Healthz       Healthz
	BlockchainAPI BlockchainAPI
	Metadata      Metadata
	ReCaptcha     ReCaptcha
	Locales       Locales
	Mails         Mails
}

func New

func New() (*Config, error)

New Load the config

func (*Config) BuildPort

func (c *Config) BuildPort(port int) string

BuildPort buils a port string from a port number.

func (*Config) DeepStructFields

func (c *Config) DeepStructFields(s *string, parentKey string, iface interface{})

func (*Config) GetExplorerPort

func (c *Config) GetExplorerPort() int

func (*Config) String

func (c *Config) String() string

type Healthz

type Healthz struct {
	ReadTimeout  time.Duration `config:"healthz_read_timeout"`
	WriteTimeout time.Duration `config:"healthz_write_timeout"`
}

type Locales

type Locales struct {
	Path string `config:"locales_path"`
	Lang []string
}

type Mails

type Mails struct {
	PublicKey string `config:"mails_publickey"`
	SecretKey string `config:"mails_secretkey"`
	ProxyURL  string `config:"mails_proxyurl"`
}

type Metadata

type Metadata struct {
	Title string `config:"metadata_title"`
}

type Metrics

type Metrics struct {
	Port int    `config:"metrics_port"`
	Host string `config:"metrics_host"`
}

type OAuthConfig

type OAuthConfig struct {
	ClientStore  string
	ClientID     string
	ClientSecret string
	Scopes       []string
	URLAPI       string
	Enable       bool
}

type ReCaptcha

type ReCaptcha struct {
	SiteKey   string        `config:"recaptcha_sitekey"`
	SecretKey string        `config:"recaptcha_secretkey"`
	Timeout   time.Duration `config:"recaptcha_timeout"`
	URL       string
}

Jump to

Keyboard shortcuts

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