config

package
v0.0.0-...-9828505 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Enabled bool
	JWT     *JWT
}

type Configuration

type Configuration struct {
	GlobalPassphraseFile string    `json:"-"`
	Meta                 *Meta     `json:"meta"`
	Server               *Server   `json:"server"`
	DB                   *Database `json:"database"`
	Storage              *Storage  `json:"storage"`
	Policy               *Policy   `json:"policy"`
	Outlook              *Outlook  `json:"outlook"`
}

func Load

func Load() (*Configuration, error)

func NewConfiguration

func NewConfiguration() *Configuration

func ParseFlags

func ParseFlags(fs *flag.FlagSet) *Configuration

func (*Configuration) Validate

func (c *Configuration) Validate() error

type Database

type Database struct {
	ConnectionURL string `json:"connection_url"`
}

type FileSystem

type FileSystem struct {
	Location string `json:"location"`
}

type JWT

type JWT struct {
	MinSecretLength  int    `yaml:"min_secret_length,omitempty"`
	DurationMinutes  int    `yaml:"duration_minutes,omitempty"`
	RefreshDuration  int    `yaml:"refresh_duration_minutes,omitempty"`
	MaxRefresh       int    `yaml:"max_refresh_minutes,omitempty"`
	SigningAlgorithm string `yaml:"signing_algorithm,omitempty"`
}

JWT holds data necessary for JWT configuration

type Meta

type Meta struct {
	// UIURL  string `json:"ui_url"`
	Hoster struct {
		Name    string `json:"name"`
		Address string `json:"address"`
	} `json:"hoster"`
}

type Outlook

type Outlook struct {
	Enabled bool   `json:"enabled"`
	AppID   string `json:"app_id"`
	UIURL   string `json:"ui_url"`
}

type Policy

type Policy struct {
	Identifier struct {
		Size int `json:"size"`
	} `json:"identifier"`
	Webhook struct {
		Enabled bool `json:"enabled"`
	} `json:"webhook"`
	Secret struct {
		MaxLength      int    `json:"max_length"`
		RevealDuration string `json:"reveal_duration"`
	} `json:"secret"`
	Passphrase struct {
		Required bool `json:"required"`
	} `json:"passphrase"`
	Storage struct {
		Enabled    bool `json:"enabled"`
		FileSystem struct {
			MaxFileSize           uint   `json:"max_filesize"`
			AllowedFileExtensions string `json:"allowed_file_extensions"`
		} `json:"filesystem"`
	} `json:"storage"`
	Security Security `json:"security"`
}

type Security

type Security struct {
	CORS struct {
		AllowedOrigins []string `json:"allowed_origins"`
		// contains filtered or unexported fields
	} `json:"cors"`
}

type Server

type Server struct {
	Address      string `json:"address"`
	BasePath     string `json:"base_path"`
	Debug        bool   `json:"debug"`
	ReadTimeout  int    `json:"read_timeout"`
	WriteTimeout int    `json:"write_timeout"`
	Auth         *Auth
}

type Storage

type Storage struct {
	Enabled    bool       `json:"enabled"`
	Provider   string     `json:"provider"`
	FileSystem FileSystem `json:"filesystem"`
}

Jump to

Keyboard shortcuts

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