config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Name    = "imsto"

	// Current ...
	Current = new(Config)
)

vars

Functions

func EnvOr

func EnvOr(key, dft string) string

EnvOr ...

func GetEngine

func GetEngine(roof string) string

GetEngine ...

func GetSections

func GetSections() map[string]string

GetSections return administrable sections

func HasSection added in v1.5.0

func HasSection(roof string) bool

HasSection ...

func InDevelop

func InDevelop() bool

InDevelop ...

func Root

func Root() string

Root ...

Types

type Config

type Config struct {
	MaxFileSize      uint              `envconfig:"MAX_FILESIZE" default:"2097152"` // 2MB
	MaxWidth         uint              `envconfig:"MAX_WIDTH" default:"1600"`
	MaxHeight        uint              `envconfig:"MAX_HEIGHT" default:"1600"`
	MinWidth         uint              `envconfig:"MIN_WIDTH" default:"50"`
	MinHeight        uint              `envconfig:"MIN_HEIGHT" default:"50"`
	MaxQuality       uint8             `envconfig:"MAX_QUALITY" default:"88"`
	CacheRoot        string            `envconfig:"CACHE_ROOT" default:"/opt/imsto/cache/"`
	LocalRoot        string            `envconfig:"LOCAL_ROOT" default:"/var/lib/imsto/"`
	StageHost        string            `envconfig:"STAGE_HOST"`     // stage.example.org
	WatermarkFile    string            `envconfig:"WATERMARK_FILE"` // /opt/imsto/watermark.png
	WatermarkOpacity uint8             `envconfig:"WATERMARK_OPACITY" default:"30"`
	SupportSizes     Sizes             `envconfig:"SUPPORT_SIZE" default:"60,120,256"`
	Sections         map[string]string `envconfig:"SECTIONS"` // [roof]label
	Engines          map[string]string `envconfig:"ENGINES"`  // [roof]engine
	Buckets          map[string]string `envconfig:"BUCKETS"`  // [roof]bucket
	WhiteList        []IPNet           `envconfig:"WHITELIST"`
	ReadTimeout      time.Duration     `envconfig:"READ_TIMEOUT" default:"10s"`
	TiringListen     string            `envconfig:"TIRING_LISTEN" default:":8967"`
	StageListen      string            `envconfig:"STAGE_LISTEN" default:":8968"`
	RPCListen        string            `envconfig:"RPC_LISTEN" default:":8969"`
}

Config ...

type IPNet added in v1.5.0

type IPNet struct{ net.IPNet }

IPNet ...

func (*IPNet) Decode added in v1.5.0

func (z *IPNet) Decode(value string) error

Decode ...

type Section

type Section struct {
	Name   string `json:"name,omitempty"`
	Engine string `json:"engine,omitempty"`
	Label  string `json:"label,omitempty"`
	Root   string `json:"root,omitempty"`
	Host   string `json:"host,omitempty"` // stage host
}

Section ...

type Sections

type Sections map[string]Section

Sections ...

type Sizes

type Sizes []uint

Sizes ...

func (Sizes) Has

func (z Sizes) Has(v uint) bool

Has ...

Jump to

Keyboard shortcuts

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