config

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig added in v0.4.0

type AdminConfig struct {
	Mail string `kiper_value:"name:mail;help:default mail register for pluto admin"`
}

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"`
	Token       *TokenConfig       `kiper_config:"name:token"`
	View        *ViewConfig        `kiper_config:"name:view"`
	Admin       *AdminConfig       `kiper_config:"name:admin"`
	Cors        *CorsConfig        `kiper_config:"name:cors"`
	Registry    *RegistryConfig    `kiper_config:"name:registry"`
	OAuth       *OAuthConfig       `kiper_config:"name:oauth"`
}

func NewConfig

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

type CorsConfig added in v0.4.0

type CorsConfig struct {
	AllowedOrigins []string `kiper_value:"name:allow_origins;help:allow origins url;default:*"`
	AllowedHeaders []string `kiper_value:"name:allow_headers;help:allow headers;default:*"`
}

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 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 OAuthConfig added in v1.0.0

type OAuthConfig struct {
	AuthorizeCodeExpire int `kiper_value:"name:authorize_code_expire;help:expire time(s) of authorize;default:3600"`
}

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 RegistryConfig added in v1.0.0

type RegistryConfig struct {
	Consul        bool   `kiper_value:"name:consul;help:use consul register;default:false"`
	ConsulAddress string `kiper_value:"name:consul_address;help:consul address;default:127.0.0.1"`
	ConsulPort    *Port  `kiper_value:"name:consul_port;help:consul port;default:8500"`
	ServiceName   string `kiper_value:"name:service_name;help:register service name;default:pluto"`
}

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"`
	CookieSecure           bool   `kiper_value:"name:cookie_secure;cookie secure;default:true"`
	ServerName             string `kiper_value:"name:server_name;help:server name;default:pluto"`
}

type TokenConfig added in v1.0.0

type TokenConfig struct {
	AccessTokenExpire         int64 `kiper_value:"name:access_token_expire;help:expire time(s) of access token;default:3600"`
	ResetPasswordTokenExpire  int64 `kiper_value:"name:reset_password_token_expire;help:expire time(s) of reset password token;default:36000"`
	RegisterVerifyTokenExpire int64 `kiper_value:"name:register_verify_token_expire;help:expire time(s) of reset password result token;default:36000"`
	RefreshTokenExpire        int64 `kiper_value:"name:refresh_token_expire;help:expire time(s) of refresh token;default:2419200"`
}

type ViewConfig

type ViewConfig struct {
	Path      string `kiper_value:"name:path;help:path of html view files;default:./views"`
	Languages string `kiper_value:"name:language;help:support languages;default:en,zh,ja"`
}

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