config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Opts = Config{}

Opts represents server side configuration for Staple.

Functions

This section is empty.

Types

type Config

type Config struct {
	AutoTLS        bool
	CacheDir       string
	ServerKeyPath  string
	ServerCrtPath  string
	Port           string
	Hostname       string
	GlobalTokenKey string
	Database       struct {
		Hostname string
		Username string
		Password string
		Database string
	}
	Mailer struct {
		Domain string
		APIKey string
	}
	DevMode bool
	Logger  zerolog.Logger
	Debug   bool
}

Config contains configuration options for the inner server of Staple.

type Message

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

Message represents an error message.

func APIError

func APIError(m string, code int, err error) Message

APIError wraps a message and a code into a struct for JSON parsing.

Jump to

Keyboard shortcuts

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