config

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedFormat

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

func (*AllowedFormat) Set

func (f *AllowedFormat) Set(s string) error

func (*AllowedFormat) String

func (f *AllowedFormat) String() string

type AllowedLevel

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

func (*AllowedLevel) GetLevelOption

func (l *AllowedLevel) GetLevelOption() level.Option

func (*AllowedLevel) Set

func (l *AllowedLevel) Set(s string) error

func (*AllowedLevel) String

func (l *AllowedLevel) String() string

type AppleLoginConfig added in v0.2.0

type AppleLoginConfig struct {
	TeamID      string `kiper_value:"name:team_id;help:apple team id"`
	BundleID    string `kiper_value:"name:bundle_id;help:apple bundle id"`
	ClientID    string `kiper_value:"name:client_id;help:apple service id"`
	KeyID       string `kiper_value:"name:key_id;help:apple key id"`
	P8CertFile  string `kiper_value:"name:p8_cert_file;help:p8 cert file path"`
	RedirectURL string `kiper_value:"name:redirect_url;help:redirect url"`
}

type AvatarConfig

type AvatarConfig struct {
	Bucket          *string `kiper_value:"name:bucket;help:aliyun oss bucket"`
	EndPoint        *string `kiper_value:"name:endpoint;help:end point"`
	AccessKeyID     *string `kiper_value:"name:accesskeyid;help:access key id"`
	AccessKeySecret *string `kiper_value:"name:accesskeysecret;help:access key secret"`
	CDN             *string `kiper_value:"name:cdn;help:cdn url"`
}

type Config

type Config struct {
	Version     string
	Server      *ServerConfig      `kiper_config:"name:server"`
	Log         *LogConfig         `kiper_config:"name:log"`
	RSA         *RSAConfig         `kiper_config:"name:rsa"`
	Database    *DatabaseConfig    `kiper_config:"name:database"`
	Mail        *MailConfig        `kiper_config:"name:mail"`
	Avatar      *AvatarConfig      `kiper_config:"name:avatar"`
	GoogleLogin *GoogleLoginConfig `kiper_config:"name:google_login"`
	WechatLogin *WechatLoginConfig `kiper_config:"name:wechat_login"`
	AppleLogin  *AppleLoginConfig  `kiper_config:"name:apple_login"`
	JWT         *JWTConfig         `kiper_config:"name:jwt"`
	View        *ViewConfig        `kiper_config:"name:view"`
}

func NewConfig

func NewConfig(args []string, version string) (*Config, error)

type DBType

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

func (*DBType) Set

func (dt *DBType) Set(t string) error

func (*DBType) String

func (dt *DBType) String() string

type DatabaseConfig

type DatabaseConfig struct {
	Type         *DBType `kiper_value:"name:type;help:database type;default:mysql"`
	MaxOpenConns int     `kiper_value:"name:max_open_conns;help:max open connections of db;default:0"`
	MaxIdleConns int     `kiper_value:"name:max_idle_conns;help:max idle connections of db;default:20"`
	Host         string  `kiper_value:"name:host;help:database host;default:127.0.0.1"`
	User         string  `kiper_value:"name:user;help:database user;default:root"`
	Password     string  `kiper_value:"name:password;help:database password"`
	Port         *Port   `kiper_value:"name:port;help:database port;default:3306"`
	DB           string  `kiper_value:"name:db;help:db name;default:pluto"`
}

type GoogleLoginConfig

type GoogleLoginConfig struct {
	Aud *string `kiper_value:"name:aud;help:audience"`
}

type JWTConfig

type JWTConfig struct {
	AccessTokenExpire              int64 `kiper_value:"name:access_token_expire;help:expire time(s) of access token;default:600"`
	ResetPasswordTokenExpire       int64 `kiper_value:"name:reset_password_token_expire;help:expire time(s) of reset password token;default:1200"`
	ResetPasswordResultTokenExpire int64 `kiper_value:"name:reset_password_result_token_expire;help:expire time(s) of reset password result token;default:300"`
	RegisterVerifyTokenExpire      int64 `kiper_value:"name:register_verify_token_expire;help:expire time(s) of reset password result token;default:300"`
}

type LogConfig

type LogConfig struct {
	Level  *AllowedLevel  `kiper_value:"name:level;help:log level = debug, info, warn, error;default:info"`
	Format *AllowedFormat `kiper_value:"name:format;help:log format = json, logfmt;default:logfmt"`
	File   *string        `kiper_value:"name:file;help:log file path"`
}

type MailConfig

type MailConfig struct {
	SMTP     *SMTP   `kiper_value:"name:smtp"`
	User     *string `kiper_value:"name:user"`
	Password *string `kiper_value:"name:password"`
}

type PlutoConfig

type PlutoConfig interface {
}

type PlutoValue

type PlutoValue interface {
	Set(string) error
	String() string
}

type Port

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

func (*Port) Set

func (p *Port) Set(s string) error

func (*Port) String

func (p *Port) String() string

type RSAConfig

type RSAConfig struct {
	Path *string `kiper_value:"name:path;help:rsa file path;default:./"`
	Name *string `kiper_value:"name:name;help:rsa file name;default:id_rsa"`
}

type SMTP

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

func (*SMTP) Set

func (smtp *SMTP) Set(s string) error

func (*SMTP) String

func (smtp *SMTP) String() string

type ServerConfig

type ServerConfig struct {
	// skip sending verify mail when mail register
	SkipRegisterVerifyMail bool `kiper_value:"name:skip_register_verify_mail;default:false"`

	Port *Port `kiper_value:"name:port;help:server listen port;default:8010"`
}

type ViewConfig

type ViewConfig struct {
	Path string `kiper_value:"name:path;help:path of html view files;default:./views"`
}

type WechatLoginConfig

type WechatLoginConfig struct {
	AppID  *string `kiper_value:"name:app_id;help:wechat app id"`
	Secret *string `kiper_value:"name:secret;help:wechat secret"`
}

Jump to

Keyboard shortcuts

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