models

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package models implements models.

Index

Constants

View Source
const (
	LogStd   = "logstd"
	LogRus   = "logrus"
	XDraw    = "xdraw"
	NfntCrop = "nfnt_crop"
	MD5      = "md5"
	SHA1     = "sha1"
	SHA256   = "sha256"
	LRU      = "lru"
	NoLimit  = "nolimit"
	Disk     = "disk"
	InMemory = "inmemory"
)

implementer's constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Source           string                 `yaml:"-"`
	Logger           string                 `yaml:"logger"`
	LogFile          string                 `yaml:"log_file"`
	LogLevel         string                 `yaml:"log_level"`
	ListenHTTP       string                 `yaml:"http_listen"`
	ListenPrometheus string                 `yaml:"prometheus_listen"`
	ListenPprof      string                 `yaml:"pprof_listen"`
	Previewer        string                 `yaml:"previewer"`
	Interpolation    entities.Interpolation `yaml:"interpolation"`
	NoProxyHeaders   []string               `yaml:"no_proxy_headers"`
	ImageURLEncoder  string                 `yaml:"img_url_encoder"`
	Cacher           string                 `yaml:"cache"`
	MaxCacheItems    int                    `yaml:"max_cache_items"`
	Storager         string                 `yaml:"storage"`
	StoragePath      string                 `yaml:"storage_path"`
}

Config is the base config struct.

func (Config) FillConfig added in v0.2.1

func (c Config) FillConfig(inConfig Config) (Config, error)

FillConfig fills empty config's fields.

func (Config) GetDefaults

func (c Config) GetDefaults() ConfigDefaults

GetDefaults returns default config fields.

type ConfigDefaults added in v0.2.1

type ConfigDefaults map[string]interface{}

ConfigDefaults is for default parameters.

type Configer

type Configer interface {
	GetConfig() Config
	SetConfig(Config)
}

Configer is the main interface for configs.

type Logger

type Logger struct {
	Fields     LoggerFields
	WithFields bool
}

Logger is the base struct for all loggers.

type LoggerFields

type LoggerFields map[string]interface{}

LoggerFields is the log fields type.

type Loggerer

type Loggerer interface {
	GetLogger() Loggerer
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	WithFields(LoggerFields) Loggerer
}

Loggerer is the main interface for loggers.

Jump to

Keyboard shortcuts

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