config

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 7 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 GetPrefix added in v1.5.4

func GetPrefix(roof string) string

GetPrefix ...

func HasSection added in v1.5.0

func HasSection(roof string) bool

HasSection ...

func InDevelop

func InDevelop() bool

InDevelop ...

Types

type Config

type Config struct {
	DatabaseDSN      string            `envconfig:"META_DSN"`
	SentryDSN        string            `envconfig:"SENTRY_DSN"`
	MaxFileSize      uint32            `envconfig:"MAX_FILESIZE" default:"2097152"` // 2MB
	MaxWidth         uint32            `envconfig:"MAX_WIDTH" default:"1600"`
	MaxHeight        uint32            `envconfig:"MAX_HEIGHT" default:"1600"`
	MinWidth         uint32            `envconfig:"MIN_WIDTH" default:"50"`
	MinHeight        uint32            `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"`
	Roofs            []string          `envconfig:"ROOFS" default:"demo"` // roof1,roof2
	Engines          map[string]string `envconfig:"ENGINES"`              // [roof]engine
	Prefixes         map[string]string `envconfig:"PREFIXES"`             // [roof]prefix
	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 Sizes

type Sizes = imagio.Sizes

Sizes ...

Jump to

Keyboard shortcuts

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