config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const StorageTypeFS = "fs"

Variables

This section is empty.

Functions

func BuildDSN

func BuildDSN(config Database, fallback Database) string

func ParseAllowedImageConfigs

func ParseAllowedImageConfigs(configs string) ([]imageproxy.ImageConfig, error)

Types

type AuthBasicAuthConfig added in v0.4.0

type AuthBasicAuthConfig struct {
	Username string
	Password string
}

type AuthType added in v0.4.0

type AuthType string
const (
	AuthTypeBasicAuth AuthType = "BASIC_AUTH"
	AuthTypeOIDC      AuthType = "OIDC"
)

type Config

type Config struct {
	Authentication struct {
		Type      AuthType
		BasicAuth struct {
			Username string
			Password string
		}
		OIDC struct {
			IssuerURL string
		}
	}
	Database struct {
		Default Database
		Content Database
		Product Database
	}
	Features struct {
		Categories struct {
			Enabled bool
		}
		Manufacturers struct {
			Enabled bool
		}
		Products struct {
			Enabled bool
		}
		Content struct {
			Enabled bool
			List    ContentList
		}
		Events struct {
			Enabled       bool
			WholeDaysOnly bool
		}
	}
	ImageProxy struct {
		BaseURL string
		Key     string
		Salt    string

		// Comma-separated list of allowed configs in format width:height:resizingType.
		// Example "100:100:FILL,300:200:FIT". Use "*" if not limiting the configs.
		AllowedConfigs string
	}
	Server struct {
		Debug          bool
		Port           int
		TrustedProxies []string
	}
	Storage struct {
		Images Storage
	}
}

func ParseConfig

func ParseConfig() (*Config, error)

type Content

type Content struct {
	Name        string
	ContentType string
}

func (Content) ToEntity

func (c Content) ToEntity() entities.Content

type ContentList

type ContentList []Content

func (ContentList) ToEntity

func (cl ContentList) ToEntity() []entities.Content

type Database

type Database struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
}

type Storage

type Storage struct {
	Type string
	Path string
}

Jump to

Keyboard shortcuts

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