config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server  ServerConf  `json:"server"`
	Resizer ResizerConf `json:"resizer"`
	Sharer  *SharerConf `json:"sharer"`
	Storage StorageConf `json:"storage"`
}

func Parse

func Parse(configFile string) (*Config, error)

type OutputFormat

type OutputFormat string
const OutputTypeJpeg OutputFormat = "jpeg"
const OutputTypeVary OutputFormat = "vary"
const OutputTypeWebp OutputFormat = "webp"

type ResizerConf

type ResizerConf struct {
	SignatureMethod string          `json:"signature_method"`
	SignatureSecret string          `json:"signature_secret"`
	Presets         json.RawMessage `json:"presets"`
	OutputType      OutputFormat    `json:"output_format"`
	WebpQCorrection int             `json:"webp_q_correction"`
	JpegQCorrection int             `json:"jpeg_q_correction"`
}

type ServerConf

type ServerConf struct {
	BindTo             string `json:"bind_to"`
	MaxClients         int    `json:"max_clients"`
	Concurrency        int    `json:"concurrency"`
	FreeMemoryInterval int    `json:"free_memory_interval"`
	LogFile            string `json:"log_file"`
	MemoryLimit        int64  `json:"go_memory_limit"`
}

type SharerConf

type SharerConf struct {
	Font     string `json:"font"`
	FontFile string `json:"font_file"`
}

type StorageConf

type StorageConf struct {
	Credentials string `json:"credentials"`
	Region      string `json:"region"`
	Bucket      string `json:"bucket"`
	CachePath   string `json:"cache_path"`
	MaxWidth    int    `json:"max_width"`
	MaxHeight   int    `json:"max_height"`
}

Jump to

Keyboard shortcuts

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