apiserver

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrChecker

func ErrChecker(err error)

ErrChecker method for check error and show message

func GetEnv

func GetEnv(key, fallback string) string

GetEnv function for getting environment variables values, or return fallback

func Routes

func Routes(router *mux.Router)

Routes list of the available routes for project

func ValidateConfigPath

func ValidateConfigPath(path string) error

ValidateConfigPath just makes sure, that the path provided is a file, that can be read

Types

type APIServer

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

APIServer struct.

func NewServer

func NewServer(config *Config) *APIServer

NewServer method for init new server instance.

func (*APIServer) Start

func (s *APIServer) Start()

Start method for start new server.

type Config

type Config struct {
	Server   server   `yaml:"server"`
	Database database `yaml:"database"`
	Static   static   `yaml:"static"`
}

Config struct for project config

func NewConfig

func NewConfig(configPath string) (*Config, error)

NewConfig returns a new decoded Config struct

Jump to

Keyboard shortcuts

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