conf

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PyroscopeSetting        *PyroscopeSettingS
	DatabaseSetting         *DatabaseSetingS
	MysqlSetting            *MySQLSettingS
	PostgresSetting         *PostgresSettingS
	Sqlite3Setting          *Sqlite3SettingS
	ServerSetting           *HttpServerSettingS
	WebServerSetting        *HttpServerSettingS
	AdminServerSetting      *HttpServerSettingS
	SpaceXServerSetting     *HttpServerSettingS
	BotServerSetting        *HttpServerSettingS
	LocalossServerSetting   *HttpServerSettingS
	FrontendWebSetting      *HttpServerSettingS
	DocsServerSetting       *HttpServerSettingS
	MobileServerSetting     *GRPCServerSettingS
	AppSetting              *AppSettingS
	CacheIndexSetting       *CacheIndexSettingS
	SimpleCacheIndexSetting *SimpleCacheIndexSettingS
	BigCacheIndexSetting    *BigCacheIndexSettingS
	SmsJuheSetting          *SmsJuheSettings
	AlipaySetting           *AlipaySettingS
	TweetSearchSetting      *TweetSearchS
	ZincSetting             *ZincSettingS
	MeiliSetting            *MeiliSettingS
	ObjectStorage           *ObjectStorageS
	AliOSSSetting           *AliOSSSettingS
	COSSetting              *COSSettingS
	HuaweiOBSSetting        *HuaweiOBSSettingS
	MinIOSetting            *MinIOSettingS
	S3Setting               *S3SettingS
	LocalOSSSetting         *LocalOSSSettingS
	JWTSetting              *JWTSettingS
	Mutex                   *sync.Mutex
)
View Source
var (
	Redis *redis.Client
)

Functions

func GetOssDomain added in v0.2.0

func GetOssDomain() string

func Initialize

func Initialize(suite []string, noDefault bool)

func MustGormDB added in v0.2.0

func MustGormDB() *gorm.DB

func OpenSqlite3 added in v0.2.0

func OpenSqlite3() (*sql.DB, error)

func RunMode added in v0.2.0

func RunMode() string

Types

type AliOSSSettingS

type AliOSSSettingS struct {
	AccessKeyID     string
	AccessKeySecret string
	Endpoint        string
	Bucket          string
	Domain          string
}

type AlipaySettingS

type AlipaySettingS struct {
	AppID             string
	PrivateKey        string
	RootCertFile      string
	PublicCertFile    string
	AppPublicCertFile string
	InProduction      bool
}

type AppSettingS

type AppSettingS struct {
	RunMode               string
	MaxCommentCount       int64
	AttachmentIncomeRate  float64
	DefaultContextTimeout time.Duration
	DefaultPageSize       int
	MaxPageSize           int
}

type BigCacheIndexSettingS added in v0.2.0

type BigCacheIndexSettingS struct {
	MaxIndexPage     int
	HardMaxCacheSize int
	ExpireInSecond   time.Duration
	Verbose          bool
}

type COSSettingS added in v0.2.0

type COSSettingS struct {
	SecretID  string
	SecretKey string
	Region    string
	Bucket    string
	Domain    string
}

type CacheIndexSettingS added in v0.2.0

type CacheIndexSettingS struct {
	MaxUpdateQPS int
	MinWorker    int
}

type DatabaseSetingS

type DatabaseSetingS struct {
	TablePrefix string
	LogLevel    string
}

type GRPCServerSettingS added in v0.2.0

type GRPCServerSettingS struct {
	Host string
	Port string
}

type HttpServerSettingS added in v0.2.0

type HttpServerSettingS struct {
	RunMode      string
	HttpIp       string
	HttpPort     string
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

func (*HttpServerSettingS) GetReadTimeout added in v0.2.0

func (s *HttpServerSettingS) GetReadTimeout() time.Duration

func (*HttpServerSettingS) GetWriteTimeout added in v0.2.0

func (s *HttpServerSettingS) GetWriteTimeout() time.Duration

type HuaweiOBSSettingS added in v0.2.0

type HuaweiOBSSettingS struct {
	AccessKey string
	SecretKey string
	Endpoint  string
	Bucket    string
	Domain    string
}

type JWTSettingS

type JWTSettingS struct {
	Secret string
	Issuer string
	Expire time.Duration
}

type LocalOSSSettingS

type LocalOSSSettingS struct {
	SavePath string
	Secure   bool
	Bucket   string
	Domain   string
}

type LoggerFileSettingS

type LoggerFileSettingS struct {
	SavePath string
	FileName string
	FileExt  string
}

type LoggerMeiliSettingS added in v0.2.0

type LoggerMeiliSettingS struct {
	Host         string
	Index        string
	ApiKey       string
	Secure       bool
	MaxLogBuffer int
	MinWorker    int
}

func (*LoggerMeiliSettingS) Endpoint added in v0.2.0

func (s *LoggerMeiliSettingS) Endpoint() string

type LoggerSettingS added in v0.2.0

type LoggerSettingS struct {
	Level string
}

type LoggerZincSettingS

type LoggerZincSettingS struct {
	Host     string
	Index    string
	User     string
	Password string
	Secure   bool
}

func (*LoggerZincSettingS) Endpoint added in v0.2.0

func (s *LoggerZincSettingS) Endpoint() string

type MeiliSettingS added in v0.2.0

type MeiliSettingS struct {
	Host   string
	Index  string
	ApiKey string
	Secure bool
}

func (*MeiliSettingS) Endpoint added in v0.2.0

func (s *MeiliSettingS) Endpoint() string

type MinIOSettingS

type MinIOSettingS struct {
	AccessKey string
	SecretKey string
	Secure    bool
	Endpoint  string
	Bucket    string
	Domain    string
}

type MySQLSettingS

type MySQLSettingS struct {
	UserName     string
	Password     string
	Host         string
	DBName       string
	Charset      string
	ParseTime    bool
	MaxIdleConns int
	MaxOpenConns int
}

func (*MySQLSettingS) Dsn

func (s *MySQLSettingS) Dsn() string

type ObjectStorageS added in v0.2.0

type ObjectStorageS struct {
	RetainInDays int
	TempDir      string
}

func (*ObjectStorageS) TempDirSlash added in v0.2.0

func (s *ObjectStorageS) TempDirSlash() string

type PostgresSettingS

type PostgresSettingS map[string]string

func (PostgresSettingS) Dsn

func (s PostgresSettingS) Dsn() string

type PyroscopeSettingS added in v0.2.0

type PyroscopeSettingS struct {
	AppName   string
	Endpoint  string
	AuthToken string
	Logger    string
}

func (*PyroscopeSettingS) GetLogger added in v0.2.0

func (s *PyroscopeSettingS) GetLogger() (logger pyroscope.Logger)

type RedisSettingS

type RedisSettingS struct {
	Host     string
	Password string
	DB       int
}

type S3SettingS

type S3SettingS struct {
	AccessKey string
	SecretKey string
	Secure    bool
	Endpoint  string
	Bucket    string
	Domain    string
}

type Setting

type Setting struct {
	// contains filtered or unexported fields
}

func NewSetting

func NewSetting() (*Setting, error)

func (*Setting) ReadSection

func (s *Setting) ReadSection(k string, v any) error

func (*Setting) Unmarshal

func (s *Setting) Unmarshal(objects map[string]any) error

type SimpleCacheIndexSettingS

type SimpleCacheIndexSettingS struct {
	MaxIndexSize       int
	CheckTickDuration  time.Duration
	ExpireTickDuration time.Duration
}

type SmsJuheSettings

type SmsJuheSettings struct {
	Gateway string
	Key     string
	TplID   string
	TplVal  string
}

type Sqlite3SettingS

type Sqlite3SettingS struct {
	Path string
}

func (*Sqlite3SettingS) Dsn added in v0.2.0

func (s *Sqlite3SettingS) Dsn(driverName string) string

type TweetSearchS added in v0.2.0

type TweetSearchS struct {
	MaxUpdateQPS int
	MinWorker    int
}

type ZincSettingS

type ZincSettingS struct {
	Host     string
	Index    string
	User     string
	Password string
	Secure   bool
}

func (*ZincSettingS) Endpoint added in v0.2.0

func (s *ZincSettingS) Endpoint() string

Jump to

Keyboard shortcuts

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