conf

package
v0.0.0-...-8be1489 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 23 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

func GetOssDomain() string

func Initialize

func Initialize(suite []string, noDefault bool)

func MustGormDB

func MustGormDB() *gorm.DB

func OpenSqlite3

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

func RunMode

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

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

type COSSettingS

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

type CacheIndexSettingS

type CacheIndexSettingS struct {
	MaxUpdateQPS int
	MinWorker    int
}

type DatabaseSetingS

type DatabaseSetingS struct {
	TablePrefix string
	LogLevel    string
}

type GRPCServerSettingS

type GRPCServerSettingS struct {
	Host string
	Port string
}

type HttpServerSettingS

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

func (*HttpServerSettingS) GetReadTimeout

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

func (*HttpServerSettingS) GetWriteTimeout

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

type HuaweiOBSSettingS

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

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

func (*LoggerMeiliSettingS) Endpoint

func (s *LoggerMeiliSettingS) Endpoint() string

type LoggerSettingS

type LoggerSettingS struct {
	Level string
}

type LoggerZincSettingS

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

func (*LoggerZincSettingS) Endpoint

func (s *LoggerZincSettingS) Endpoint() string

type MeiliSettingS

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

func (*MeiliSettingS) Endpoint

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

type ObjectStorageS struct {
	RetainInDays int
	TempDir      string
}

func (*ObjectStorageS) TempDirSlash

func (s *ObjectStorageS) TempDirSlash() string

type PostgresSettingS

type PostgresSettingS map[string]string

func (PostgresSettingS) Dsn

func (s PostgresSettingS) Dsn() string

type PyroscopeSettingS

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

func (*PyroscopeSettingS) GetLogger

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

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

type TweetSearchS

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

func (s *ZincSettingS) Endpoint() string

Jump to

Keyboard shortcuts

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