config

package
v0.0.0-...-9e5d004 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	Addr string
}

AuthService stores the configuration for an authentication service.

func (*AuthService) Flags

func (a *AuthService) Flags(addr string)

Flags parses the flags configured for an auth service. The parameters it takes are the default values to use for the rps, burst and active flags respectively.

type Cors

type Cors struct {
	AllowMethods   []string
	TrustedOrigins []string
}

Cors stores the configuration for CORS (Cross-Origin Resource Sharing).

func (*Cors) Flags

func (c *Cors) Flags()

Flags parses the flags configured for CORS. TODO: These two flags are not currently populated when called.

type Limiter

type Limiter struct {
	RPS    float64
	Burst  int
	Active bool
}

Limiter stores the configuration for a rate limiter.

func (*Limiter) Flags

func (l *Limiter) Flags(rps float64, burst int, active bool)

Flags parses the flags configured for a rate limiter. The parameters it takes are the default values to use for the rps, burst and active flags respectively.

type MongoDB

type MongoDB struct {
	Host       string
	Schema     string
	PrivateKey string
}

MongoDB stores the configuration for a MongoDB NoSQL database.

func (*MongoDB) Flags

func (m *MongoDB) Flags()

Flags parses the flags for a MongoDB database.

type Server

type Server struct {
	Addr string
	Env  string
}

Server stores the configuration for a web application server.

func (*Server) Flags

func (s *Server) Flags(addr string)

Flags parses the flags for a web application server. The parameter is for the default server address.

type Service

type Service struct {
	Addr string
}

Service stores the configuration for an external service that can be called.

func (*Service) Flags

func (s *Service) Flags(flagName, flagDesc string)

Flags parses the flags for an external service. The parameters are the name and description to use for the flag.

type Smtp

type Smtp struct {
	Host     string
	Port     int
	Username string
	Password string
	Sender   string
}

Smtp stores the configuration for an SMTP server connection.

func (*Smtp) Flags

func (s *Smtp) Flags(host, sender string)

Flags parses the flags for an SMTP server connection.

type SqlDB

type SqlDB struct {
	Driver       string
	DSN          string
	MaxOpenConns int
	MaxIdleConns int
	MaxIdleTime  string
}

SqlDB stores the configuration for a SQL database.

func (*SqlDB) Flags

func (s *SqlDB) Flags(driver string, open, idle int, idleTime string)

Flags parses the flags for a SQL database. The parameters it takes are for the default max open connections, max idle connections and max idle connection times respectively.

Jump to

Keyboard shortcuts

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