app

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInvalidTransactionID                    = DomainError("invalid transaction id")
	ErrInvalidEntryID                          = DomainError("invalid entry id")
	ErrInvalidOperation                        = DomainError("invalid operation")
	ErrInvalidAmount                           = DomainError("invalid amount")
	ErrInvalidEntriesNumber                    = DomainError("invalid entries number")
	ErrInvalidBalance                          = DomainError("invalid balance")
	ErrIdempotencyKeyViolation                 = DomainError("idempotency key violation")
	ErrInvalidVersion                          = DomainError("invalid version")
	ErrAccountNotFound                         = DomainError("account not found")
	ErrInvalidAccountStructure                 = DomainError("account does not meet minimum or maximum supported sizes")
	ErrInvalidAccountComponentSize             = DomainError("account component cannot be empty and must be less than 256 characters")
	ErrInvalidSingleAccountComponentCharacters = DomainError("only alphanumeric and underscore characters are supported")
	ErrInvalidAccountComponentCharacters       = DomainError("only alphanumeric, underscore and star (*) characters are supported")
	ErrAccountPathViolation                    = DomainError("invalid depth value")
	ErrInvalidSyntheticReportStructure         = DomainError("invalid synthetic report structure")
	ErrInvalidPageSize                         = DomainError("invalid page size")
	ErrInvalidPageCursor                       = DomainError("invalid page cursor")
	ErrInvalidAccountType                      = DomainError("invalid account type")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RPCServer  RPCServerConfig
	HttpServer HttpServerConfig
	Postgres   PostgresConfig
	NewRelic   NewRelicConfig
}

func LoadConfig

func LoadConfig() (*Config, error)

type DomainError

type DomainError string

func (DomainError) Error

func (err DomainError) Error() string

type HttpServerConfig added in v0.3.0

type HttpServerConfig struct {
	Host            string        `envconfig:"HTTP_HOST" default:"0.0.0.0"`
	Port            int           `envconfig:"HTTP_PORT" default:"3001"`
	ShutdownTimeout time.Duration `envconfig:"HTTP_SHUTDOWN_TIMEOUT" default:"1s"`
	ReadTimeout     time.Duration `envconfig:"HTTP_READ_TIMEOUT" default:"30s"`
	WriteTimeout    time.Duration `envconfig:"HTTP_WRITE_TIMEOUT" default:"10s"`
}

type NewRelicConfig

type NewRelicConfig struct {
	AppName    string `envconfig:"NEW_RELIC_APP_NAME"`
	LicenseKey string `envconfig:"NEW_RELIC_LICENSE_KEY"`
}

type PostgresConfig

type PostgresConfig struct {
	DatabaseName string `envconfig:"DATABASE_NAME" default:"dev"`
	User         string `envconfig:"DATABASE_USER" default:"postgres"`
	Password     string `envconfig:"DATABASE_PASSWORD" default:"postgres"`
	Host         string `envconfig:"DATABASE_HOST" default:"localhost"`
	Port         string `envconfig:"DATABASE_PORT" default:"5432"`
	PoolMinSize  string `envconfig:"DATABASE_POOL_MIN_SIZE" default:"2"`
	PoolMaxSize  string `envconfig:"DATABASE_POOL_MAX_SIZE" default:"10"`
	SSLMode      string `envconfig:"DATABASE_SSLMODE" default:"disable"`
	SSLRootCert  string `envconfig:"DATABASE_SSL_ROOTCERT"`
	SSLCert      string `envconfig:"DATABASE_SSL_CERT"`
	SSLKey       string `envconfig:"DATABASE_SSL_KEY"`
}

func (PostgresConfig) DSN

func (c PostgresConfig) DSN() string

func (PostgresConfig) URL

func (c PostgresConfig) URL() string

type RPCServerConfig added in v0.3.0

type RPCServerConfig struct {
	Host            string        `envconfig:"GRPC_HOST" default:"0.0.0.0"`
	Port            int           `envconfig:"GRPC_PORT" default:"3000"`
	ShutdownTimeout time.Duration `envconfig:"APP_SHUTDOWN_TIMEOUT" default:"5s"`
	ReadTimeout     time.Duration `envconfig:"GRPC_READ_TIMEOUT" default:"30s"`
	WriteTimeout    time.Duration `envconfig:"GRPC_WRITE_TIMEOUT" default:"10s"`
}

Jump to

Keyboard shortcuts

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