setting

package
v0.0.0-...-e282ec7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnableSQLite3 bool
	Database      DatabaseConfig
)
View Source
var (
	CustomPath        string   = "custom"
	CustomConfigName  string   = "config"
	CustomConfigPaths []string = []string{".", "config"}
	CustomConfigType  string   = "yaml"
	UsedConfigFile    string   = "config.yaml"

	IsWindows bool

	AppName     string
	AppPath     string
	AppWorkPath string
	AppDataPath string
	AppURL      string
	AppSubURL   string

	ServerMode        string
	Protocol          string
	Domain            string
	HTTPAddr          string
	HTTPPort          string
	CertFile          string
	KeyFile           string
	EnableLetsEncrypt bool
	LetsEncryptTOS    bool
	LetsEncryptDir    string
	LetsEncryptHost   []string
	EnableGzip        bool
	StaticRootPath    string

	AvatarMaxWidth   int
	AvatarMaxHeight  int
	AvatarUploadPath string
	FileUploadPath   string

	API struct {
		DefaultPagingSize int
		MaxPagingSize     int
	}

	PasswordComplexity []string
)
View Source
var (
	CacheService = struct {
		Cache
	}{
		Cache: Cache{
			Enabled:  true,
			Adapter:  "memory",
			Interval: 60 * time.Second,
			TTL:      24 * time.Hour,
		},
	}
)
View Source
var (
	LFS = struct {
		Storage
	}{}
)
View Source
var Service struct {
	ActiveCodeLive            time.Duration
	ResetPasswordCodeLive     time.Duration
	ActiveCodeInterval        time.Duration
	ResetPasswordCodeInterval time.Duration
	RegisterEmailConfirm      bool
	MaxFileCapacitySize       int64
	AvatarMaxSize             int64
}
View Source
var (
	SessionConfig = struct {
		Provider       string
		ProviderConfig string
		CookieName     string
		CookiePath     string
		Domain         string
		MaxAge         int64
		Secure         bool
		HttpOnly       bool
	}{
		MaxAge: 86400,
	}
)

Functions

func NewServices

func NewServices()

func NewSetting

func NewSetting()

func SaveSetting

func SaveSetting()

func SetCustomPath

func SetCustomPath()

Types

type Cache

type Cache struct {
	Enabled  bool
	Adapter  string
	Url      string
	Interval time.Duration
	TTL      time.Duration
}

type DatabaseConfig

type DatabaseConfig struct {
	Driver       string
	URL          string
	MaxIdleConns int
	MaxOpenConns int
	MaxListTime  time.Duration
}

type Mailer

type Mailer struct {
	QueueLength     int
	SubjectPrefix   string
	SendAsPlainText bool
	From            string
	FromName        string
	FromEmail       string

	//SMTP
	Host           string
	Username       string
	Password       string
	SkipVerify     bool
	UseCertificate bool
	CertFile       string
	KeyFile        string
	IsTLSEnable    bool
}
var (
	MailerService *Mailer
)

type MetricsService

type MetricsService struct {
	Enabled bool
	Token   string
}
var (
	Metrics *MetricsService
)

type Pprof

type Pprof struct {
	Enabled  bool
	HTTPAddr string
	HTTPPort string
}
var (
	PprofService *Pprof
)

type QueueSetting

type QueueSetting struct {
	Type         string
	Name         string
	Length       int
	BatchLength  int
	QueueName    string
	BoostWorker  int
	MaxWorkers   int
	Workers      int
	BlockTimeout time.Duration
	BoostTimeout time.Duration
}
var (
	Queue *QueueSetting
)

func GetQueueSetting

func GetQueueSetting(name string) *QueueSetting

type Storage

type Storage struct {
	Type string
	Path string
	Name string
}

func (*Storage) Unmarshal

func (s *Storage) Unmarshal(v interface{}) error

Jump to

Keyboard shortcuts

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