conf

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeString = "string"
	TypeSelect = "select"
	TypeBool   = "bool"
	TypeText   = "text"
	TypeNumber = "number"
)
View Source
const (
	// site
	VERSION      = "version"
	ApiUrl       = "api_url"
	BasePath     = "base_path"
	SiteTitle    = "site_title"
	Announcement = "announcement"

	Favicon   = "favicon"
	MainColor = "main_color"

	// preview
	TextTypes  = "text_types"
	AudioTypes = "audio_types"
	VideoTypes = "video_types"
	ImageTypes = "image_types"
	//OfficeTypes   = "office_types"
	ProxyTypes    = "proxy_types"
	OfficeViewers = "office_viewers"
	PdfViewers    = "pdf_viewers"
	AudioAutoplay = "audio_autoplay"
	VideoAutoplay = "video_autoplay"

	// global
	HideFiles      = "hide_files"
	GlobalReadme   = "global_readme"
	CustomizeHead  = "customize_head"
	CustomizeBody  = "customize_body"
	LinkExpiration = "link_expiration"
	PrivacyRegs    = "privacy_regs"
	OcrApi         = "ocr_api"

	// aria2
	Aria2Uri    = "aria2_uri"
	Aria2Secret = "aria2_secret"

	// single
	Token = "token"
)
View Source
const (
	UNKNOWN = iota
	FOLDER
	//OFFICE
	VIDEO
	AUDIO
	TEXT
	IMAGE
)

Variables

View Source
var (
	BuiltAt    string
	GoVersion  string
	GitAuthor  string
	GitCommit  string
	Version    string = "dev"
	WebVersion string
)
View Source
var (
	RawIndexHtml string
	ManageHtml   string
	IndexHtml    string
)
View Source
var PrivacyReg []*regexp.Regexp
View Source
var (
	// StoragesLoaded loaded success if empty
	StoragesLoaded = false
)
View Source
var TypesMap = make(map[string][]string)

Functions

This section is empty.

Types

type Config

type Config struct {
	Force          bool      `json:"force" env:"FORCE"`
	Address        string    `json:"address" env:"ADDR"`
	Port           int       `json:"port" env:"PORT"`
	SiteURL        string    `json:"site_url" env:"SITE_URL"`
	Cdn            string    `json:"cdn" env:"CDN"`
	JwtSecret      string    `json:"jwt_secret" env:"JWT_SECRET"`
	TokenExpiresIn int       `json:"token_expires_in" env:"TOKEN_EXPIRES_IN"`
	Database       Database  `json:"database"`
	Scheme         Scheme    `json:"scheme"`
	TempDir        string    `json:"temp_dir" env:"TEMP_DIR"`
	Log            LogConfig `json:"log"`
}
var (
	Conf *Config
)

func DefaultConfig

func DefaultConfig() *Config

type Database

type Database struct {
	Type        string `json:"type" env:"DB_TYPE"`
	Host        string `json:"host" env:"DB_HOST"`
	Port        int    `json:"port" env:"DB_PORT"`
	User        string `json:"user" env:"DB_USER"`
	Password    string `json:"password" env:"DB_PASS"`
	Name        string `json:"name" env:"DB_NAME"`
	DBFile      string `json:"db_file" env:"DB_FILE"`
	TablePrefix string `json:"table_prefix" env:"DB_TABLE_PREFIX"`
	SSLMode     string `json:"ssl_mode" env:"DB_SSL_MODE"`
}

type LogConfig

type LogConfig struct {
	Enable     bool   `json:"enable" env:"LOG_ENABLE"`
	Name       string `json:"name" env:"LOG_NAME"`
	MaxSize    int    `json:"max_size" env:"MAX_SIZE"`
	MaxBackups int    `json:"max_backups" env:"MAX_BACKUPS"`
	MaxAge     int    `json:"max_age" env:"MAX_AGE"`
	Compress   bool   `json:"compress" env:"COMPRESS"`
}

type Scheme

type Scheme struct {
	Https    bool   `json:"https" env:"HTTPS"`
	CertFile string `json:"cert_file" env:"CERT_FILE"`
	KeyFile  string `json:"key_file" env:"KEY_FILE"`
}

Jump to

Keyboard shortcuts

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