config

package
v0.0.0-...-97ddbf9 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 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 Ingredients

type Ingredients struct {
	// Addr is full address to connect to Ingredients server.
	//
	// e.g. localhost:5000 or example.org
	Addr string `config:"ingredients-addr"`
	// UseTLS is used to use TLS transport credentials in work with service.
	UseTLS bool `config:"ingredients-use-tls"`
	// CertFile is location of CertFile.
	CertFile string `config:"ingredients-cert-file"`
	// KeyFile is location of KeyFile.
	KeyFile string `config:"ingredients-key-file"`
}

Ingredients is configuration of Ingredients Client.

func NewIngredients

func NewIngredients() (*Ingredients, error)

NewIngredients creates new Ingredients config and Loads data from env/flag to it.

type Server

type Server struct {
	// BindAddr is Host address
	// Default: localhost
	BindAddr string `config:"bind-addr,short=a"`
	// BindPort is port on which application will be running at.
	// By default is 8080
	BindPort int `config:"bind-port,short=p"`
	// BindHost is external address of system.
	//
	// Do not add protocol in front of this parameter.
	// Bad: https://example.org http://example.org
	// Good: example.org
	//
	// If you set it to outer domain address and set UseHTTPS to true
	// then application will autogenerate cert file to use LetsEncrypt encryption.
	BindHost string `config:"bind-host"`
	// UseHTTPS is bool attribute to run HTTPS server instea of HTTP.
	// If setted to true then it will generate autocert file for you.
	UseHTTPS bool `config:"https"`
	// Timeout is timeout of server to wait for response.
	Timeout time.Duration `config:"server-timeout"`
	// AllowHosts is used in CORS configurations.
	AllowHosts []string `config:"allow-hosts"`
	// CertFile is location of cert file.
	CertFile string `config:"cert-file"`
	// KeyFile is location of cert key file
	KeyFile string `config:"key-file"`

	SentryDNS string `config:"sentry-dns"`
	// contains filtered or unexported fields
}

Server is config of HTTP Server.

func NewServer

func NewServer() (*Server, error)

NewServer return new Server config.

func (Server) Addr

func (cfg Server) Addr() string

Addr return address on which application will be started at.

Use Addr while configuring HTTP server.

func (Server) FullAddr

func (cfg Server) FullAddr() string

FullAddr return external address of server.

type Tags

type Tags struct {
	// Addr is full address to connect to Tags server.
	//
	// e.g. localhost:5000 or example.org
	Addr string `config:"tags-addr"`
	// UseTLS is used to use TLS transport credentials in work with service.
	UseTLS bool `config:"tags-use-tls"`
	// CertFile is location of CertFile.
	CertFile string `config:"tags-cert-file"`
	// KeyFile is location of KeyFile.
	KeyFile string `config:"tags-key-file"`
}

Tags is config of Tags Client.

func NewTags

func NewTags() (*Tags, error)

NewTags creates new Tags config and Loads data from env/flag to it.

Jump to

Keyboard shortcuts

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