app

package
v0.0.0-...-c715d86 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = &CommonOptions{}
View Source
var Version = "1.0"

Functions

func Init

func Init(logger *logrus.Logger) routing.Handler

func LoadConfig

func LoadConfig() error

Types

type CommonOptions

type CommonOptions struct {
	Port       int               `short:"p" long:"port" description:"Port the service listens on" default:"8080"`
	Backend    string            `short:"b" long:"backend" choice:"s3" choice:"filesystem"`
	S3         S3Options         `group:"S3 configuration" namespace:"s3"`
	FileSystem FileSystemOptions `group:"Filesystem configuration" namespace:"filesystem"`
	SSLConfig  SSLOptions        `group:"SSL Configuration" namespace:"ssl"`
}

type FileSystemOptions

type FileSystemOptions struct {
	BasePath string `long:"basepath" description:"Basepath to store modules"`
}

type Logger

type Logger interface {
	SetField(name, value string)

	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
}

func NewLogger

func NewLogger(log *logrus.Logger, fields logrus.Fields) Logger

type RequestScope

type RequestScope interface {
	Logger
	Now() time.Time
}

func GetRequestScope

func GetRequestScope(c *routing.Context) RequestScope

GetRequestScope returns the RequestScope of the current request.

type S3Options

type S3Options struct {
	Bucket   string `long:"bucket" description:"S3 bucket to use as backing storage"`
	Endpoint string `long:"endpoint" description:"S3 endpoint"`
}

type SSLOptions

type SSLOptions struct {
	Certificate string `long:"certificate" description:"Path to the SSL certificate"`
	Key         string `long:"key" description:"Path to the SSL certificate key"`
}

func (SSLOptions) IsValid

func (o SSLOptions) IsValid() bool

Jump to

Keyboard shortcuts

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