gotesserver

package
v0.0.0-...-78a9fc4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(config *Config) error

Start server

Types

type Config

type Config struct {
	BindAddr          string `env:"APP_BIND_ADDR"`
	LogLevel          string `env:"APP_LOG_LEVEL"`
	DatabaseURL       string `env:"DATABASE_URL"`
	DatabaseTestURL   string `env:"DATABASE_TEST_URL"`
	TokenExpiredHours int    `env:"APP_TOKEN_EXPIRED_HOURS"`
	TokenSecret       string `env:"APP_TOKEN_SECRET"`
}

Common Config

func NewConfig

func NewConfig() *Config

Application Config

func NewTestConfig

func NewTestConfig() *Config

Config for tests

type ErrorResponse

type ErrorResponse struct {
	Code  int    `json:"code"`
	Error string `json:"error"`
}

An error structure

func NewErrorResponse

func NewErrorResponse(code int, err error) *ErrorResponse

Constructor for a new ErrorResponse

Jump to

Keyboard shortcuts

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