Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPath = "./configs/polyapi.yaml"
DefaultPath is default config file path
Functions ¶
This section is empty.
Types ¶
type AuthorizeConfig ¶
type AuthorizeConfig struct { OauthToken OauthConfig `yaml:"oauthToken"` OauthKey OauthConfig `yaml:"oauthKey"` Goalie OauthConfig `yaml:"goalie"` FileServer OauthConfig `yaml:"fileServer"` AppAccess OauthConfig `yaml:"appAccess"` AppAdmin OauthConfig `yaml:"appAdmin"` }
AuthorizeConfig presents URLs of auth config
type Config ¶
type Config struct { Port string `yaml:"port"` PortInner string `yaml:"portInner"` Model string `yaml:"model"` MyHostBase string `yaml:"myHostBase"` Gate Gate `yaml:"gate"` Authorize AuthorizeConfig `yaml:"authorize"` Log logger.Config `yaml:"log"` Mysql mysql2.Config `yaml:"mysql"` Redis redis2.Config `yaml:"redis"` }
Config presents config
var Conf *Config
Conf config
type Gate ¶
type Gate struct { LimitRate GateLimitRate `yaml:"limitRate"` APIBlock GateAPIBlock `yaml:"apiBlock"` IPBlock GateIPBlock `yaml:"ipBlock"` }
Gate config
type GateAPIBlock ¶
type GateAPIBlock struct { Enable bool `yaml:"enable" validate:"required"` MaxAllowError int64 `yaml:"maxAllowError" validate:"required,min=1,max=100"` BlockSeconds int64 `yaml:"blockSeconds" validate:"required,min=10,max=3600"` APITimeoutMS int64 `yaml:"apiTimeoutMS" validate:"required,min=1"` }
GateAPIBlock config
type GateIPBlock ¶
type GateIPBlock struct { Enable bool `yaml:"enable" validate:"required"` White []string `yaml:"white"` Black []string `yaml:"black"` }
GateIPBlock config
type GateLimitRate ¶
type GateLimitRate struct { Enable bool `yaml:"enable" validate:"required"` RatePerSecond int `yaml:"ratePerSecond" validate:"required,min=1,max=100000"` }
GateLimitRate config
Click to show internal directories.
Click to hide internal directories.