apiserver

package
v0.0.0-...-7543e54 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiServer

type ApiServer struct {
	// contains filtered or unexported fields
}

func New

func New(config *AppConfig, logger *zap.SugaredLogger, p *pgxpool.Pool, rc *redis.Client) *ApiServer

func (*ApiServer) Start

func (serv *ApiServer) Start() error

type AppConfig

type AppConfig struct {
	ServerPort string `toml:"server_port"`
	Postgres   *Postgres
	Redis      *Redis
}

func GetAppConfig

func GetAppConfig() (*AppConfig, error)

type Postgres

type Postgres struct {
	Host     string `env:"PG_HOST"`
	Port     string `env:"PG_PORT"`
	DbName   string `env:"PG_DBNAME"`
	User     string `env:"PG_USER"`
	Password string `env:"PG_PASSWORD"`
}

func (*Postgres) GetDbUrl

func (pg *Postgres) GetDbUrl() string

type Redis

type Redis struct {
	Url      string `env:"REDIS_URL"`
	Password string `env:"REDIS_PASSWORD"`
	Db       int    `env:"REDIS_DB"`
}

Jump to

Keyboard shortcuts

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