config

package
v0.9.0-rc.53 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config answers what a person wrote into pwikit.toml.

Index

Constants

View Source
const (
	EngineSMTP    = "smtp"
	EngineConsole = "console"
)
View Source
const FDEnv = "PWIKIT_CONFIG_FD"
View Source
const Template = `` /* 2988-byte string literal not displayed */

Variables

This section is empty.

Functions

func CheckMirror

func CheckMirror(mirror string) error

func ReadableByOthers

func ReadableByOthers(path string) bool

func SetUpdateMirror

func SetUpdateMirror(path, mirror string) error

The file is edited as text rather than decoded and encoded again, so the comments and the order a person gave it survive.

func WriteTemplate

func WriteTemplate(path string) (bool, error)

Types

type Analytics

type Analytics struct {
	GoogleTagID string `toml:"google_tag_id"`
}

type File

type File struct {
	Database  string    `toml:"database"`
	Server    Server    `toml:"server"`
	TLS       TLS       `toml:"tls"`
	Mail      Mail      `toml:"mail"`
	Analytics Analytics `toml:"analytics"`
	Update    Update    `toml:"update"`
	Wikidot   Wikidot   `toml:"wikidot"`
	Mounts    []Mount   `toml:"mount"`
}

func Load

func Load(path string) (File, error)

func Parse

func Parse(data []byte, path string) (File, error)

type Mail

type Mail struct {
	Engine      string `toml:"engine"`
	Host        string `toml:"host"`
	Port        int    `toml:"port"`
	Username    string `toml:"username"`
	Password    string `toml:"password"`
	UseTLS      *bool  `toml:"use_tls"`
	ImplicitTLS *bool  `toml:"implicit_tls"`
	From        string `toml:"from"`
}

type Mount

type Mount struct {
	Path        string `toml:"path"`
	Upstream    string `toml:"upstream"`
	StripPrefix bool   `toml:"strip_prefix"`
	SecretFile  string `toml:"secret_file"`
}

type Server

type Server struct {
	Listen         string   `toml:"listen"`
	TrustedProxies []string `toml:"trusted_proxies"`
	UploadLimit    string   `toml:"upload_limit"`
	StorageLimit   string   `toml:"storage_limit"`
}

type TLS

type TLS struct {
	Mode          string `toml:"mode"`
	Listen        string `toml:"listen"`
	Cert          string `toml:"cert"`
	Key           string `toml:"key"`
	ACMEEmail     string `toml:"acme_email"`
	ACMEDirectory string `toml:"acme_directory"`
}

type Update

type Update struct {
	Auto         *bool  `toml:"auto"`
	PublicBanner *bool  `toml:"public_banner"`
	Check        *bool  `toml:"check"`
	Window       string `toml:"window"`
	TimeZone     string `toml:"time_zone"`
	MinAge       string `toml:"min_age"`
	Mirror       string `toml:"mirror"`
}

type Wikidot

type Wikidot struct {
	Username       string `toml:"username"`
	Password       string `toml:"password"`
	MessageSubject string `toml:"message_subject"`
	MessageBody    string `toml:"message_body"`
}

Jump to

Keyboard shortcuts

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