config

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Private    Visibility = "private"
	Restricted            = "restricted"
	Public                = "public"
)

Variables

View Source
var AppEnvironment log.Environment
View Source
var LogLevel zapcore.Level

Functions

func BuildCachePath

func BuildCachePath(pathParts ...string) string

func BuildDataPath

func BuildDataPath(pathParts ...string) string

func BuildLibraryPath

func BuildLibraryPath(libraryPath string, pathParts ...string) string

func BuildPath added in v0.4.0

func BuildPath(base string, pathParts ...string) string

func GetInitialAdmin

func GetInitialAdmin() (string, string)

func LoadEnv

func LoadEnv()

LoadEnv loads the environment variables.

func RelativePath

func RelativePath(basePath string, fullPath string) string

func SetEnv added in v0.6.0

func SetEnv()

SetEnv sets the environment variables into Options and Credentials

Types

type CacheOptions added in v0.4.0

type CacheOptions struct {
	WebServer bool
	TTL       time.Duration
	Size      int64
}

type CredentialsModel added in v0.4.0

type CredentialsModel struct {
	JWTSecret  string
	Passphrase string
}
var Credentials *CredentialsModel // TODO: Encrypt in memory?

Credentials stores the JWT secret, and optionally a passphrase and credentials for the db

type DBOptions added in v0.4.0

type DBOptions struct {
	Name       string
	Migrations bool
}

type Layout

type Layout string
const (
	Freeform   Layout = "freeform"
	Structured        = "structured"
)

type Library

type Library struct {
	ID     int32
	Path   string
	Layout string
}

func ParseBasePaths

func ParseBasePaths() []Library

type OptionsModel added in v0.4.0

type OptionsModel struct {
	Environment   log.Environment
	Domain        string
	Hostname      string
	Port          string
	StrictACAO    bool
	Registrations bool
	Visibility    Visibility
	DB            DBOptions
	Cache         CacheOptions
}
var Options *OptionsModel

Options stores the global configuration for the server

type Visibility added in v0.4.0

type Visibility string

Jump to

Keyboard shortcuts

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