api

package
v0.0.0-...-d0ca659 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Overview

API is the package that takes care of loading the configuratio and setting up the router

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(port string, debug bool, c Config) error

StartServer gets his port and debug in the environment, registers the router, and registers the database closing on exit.

Types

type Config

type Config struct {
	TmpDir       string `yaml:"tmpDir"`
	UploadsDir   string `yaml:"uploadsDir"`
	FilesDir     string `yaml:"filesDir"`
	PublicDir    string `yaml:"publicDir"`
	TemplatesDir string `yaml:"templatesDir"`
	FixturesDir  string `yaml:"FixturesDir"`
}

Config holds port numbers, target directories

func (*Config) DefaultConf

func (c *Config) DefaultConf()

DefaultConf is called if there is an error opening and parsing the config file

func (*Config) LoadConf

func (c *Config) LoadConf(path string) error

LoadConf tries to load a yaml file from disk, and marshals it. Sensible defaults are provided, and loading a file overrides them

Directories

Path Synopsis
Models keep track of data processing, such as returning slices for complex queries, or sanitizing input data
Models keep track of data processing, such as returning slices for complex queries, or sanitizing input data

Jump to

Keyboard shortcuts

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