config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const PttArticleTemplate = `` /* 314-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleArguments added in v0.10.0

type ArticleArguments struct {
	UserData      bbs.UserRecord
	Article       bbs.ArticleRecord
	BoardID       string
	Content       string
	PostANSICDate string
}

Ptt default article template

type Config

type Config struct {
	BBSHome               string
	ListenPort            int16
	AccessTokenPrivateKey string
	AccessTokenPublicKey  string
	AccessTokenExpiresAt  time.Duration
	MailDriver            string
}

func NewConfig

func NewConfig(defaultPath, userPath string) (*Config, error)

NewConfig load and return global config from config files, it will load defaultPath first, then userPath. if defaultPath can not be read, it will return error. it userPath can not be read, it will ignore userPath. user configuration will override default configuration.

func NewDefaultConfig

func NewDefaultConfig() (*Config, error)

Jump to

Keyboard shortcuts

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