context

package
v0.0.0-...-e78e600 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(services map[string]Serve) error

Initializes the whole context.

func InitializeCustomConfig

func InitializeCustomConfig(services map[string]Serve, configuration *Configuration) error

Initializes the whole context with a custom configuration

Types

type Configuration

type Configuration struct {
	Authentication       bool             `json:"authentication"`
	DavPaths             DavPaths         `json:"davPaths"`
	GeneratedDirectory   string           `json:"generatedDirectory"`
	Host                 string           `json:"host"`
	JWTExpirationMinutes int              `json:"jwtExpirationMinutes"`
	JWTSecret            string           `json:"jwtSecret"`
	SQLiteFile           string           `json:"sqliteFile"`
	Mail                 EmailCredentials `json:"mail"`
	OrderRefer           OrderRefer       `json:"orderRefer"`
	OrderRetrievers      []*mail.Address  `json:"orderRetrievers"`
	RestMirror           RestMirror       `json:"restMirror"`
	TemplateInterval     uint             `json:"templateInterval"`
}

Struct for the configuration of the application.

var Conf Configuration

type DavPaths

type DavPaths struct {
	PayedBills   string `json:"payedBills"`
	UnpayedBills string `json:"unpayedBills"`
	Scores       string `json:"scores"`
}

Struct for all dav related paths

type EmailCredentials

type EmailCredentials struct {
	Username string        `json:"username"`
	Password string        `json:"password"`
	SMTPHost string        `json:"smtpHost"`
	Address  *mail.Address `json:"address"`
}

Struct for SMTP credentials which will be used for sending mails.

type Log

type Log func(level LogLevel, format string, a ...interface{})

Defines the function type for a single log.

type LogLevel

type LogLevel string

Represents a log level which is also used in the log.

const (
	LOG_ERROR   LogLevel = "ERROR"
	LOG_INFO    LogLevel = "INFO"
	LOG_WARNING LogLevel = "WARNING"
)

Defines all available log levels.

type OrderRefer

type OrderRefer struct {
	Host    string `json:"host"`
	Fail    string `json:"fail"`
	Success string `json:"success"`
}

Struct for refers after order

type RestMirror

type RestMirror struct {
	Interval           uint   `json:"interval"`
	CategoriesPath     string `json:"categoriesPath"`
	CategoriesFlatPath string `json:"categoriesFlatPath"`
	ScoresPath         string `json:"scoresPath"`
}

section for the rest mirror

type Serve

type Serve func(args ServiceArguments) (ServiceResult, error)

Represents a service instance.

type ServiceArguments

type ServiceArguments struct {
	GeneratedDirectory string
	Log                Log
}

Arguments to a service.

type ServiceResult

type ServiceResult struct {
	HttpHandler http.Handler
}

Results of a service.

Jump to

Keyboard shortcuts

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