server

package
v0.0.0-...-2741532 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapDatabase

func BootstrapDatabase(config Config) *mysql.ConnectionData

Types

type Api

type Api struct {
	Cfg    *Config
	Router *mux.Router
}

func NewApi

func NewApi(cfg *Config) Api

func (*Api) Bootstrap

func (a *Api) Bootstrap() error

type Config

type Config struct {
	Environment      Environment
	LogLevel         string
	Port             string
	Network          string
	ReadTimeout      time.Duration
	WriteTimeout     time.Duration
	IdleTimeout      time.Duration
	DatabaseUsername string
	DatabasePassword string
	DatabaseHost     string
	DatabaseSchema   string
	DatabaseUrl      string
}

func NewConfig

func NewConfig() *Config

type Environment

type Environment string
const (
	PROD  Environment = "production"
	BETA  Environment = "beta"
	LOCAL Environment = "local"
	TEST  Environment = "test"
)

func (Environment) IsBeta

func (e Environment) IsBeta() bool

func (Environment) IsLocal

func (e Environment) IsLocal() bool

func (Environment) IsProduction

func (e Environment) IsProduction() bool

func (Environment) IsTest

func (e Environment) IsTest() bool

type Scope

type Scope interface {
	Bootstrap(cfg Config) error
}

type Shutdown

type Shutdown func() error

Jump to

Keyboard shortcuts

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