Documentation ¶
Index ¶
Constants ¶
View Source
const ( AccessTokenCookieName string = "access_token" // AccessToken Cookie名称 RefreshTokenCookieName string = "refresh_token" // RefreshToken Cookie名称 TokenCookieMaxAge int = 60 * 60 * 24 * 7 * 52 // Cookie最大有效时间(秒) TokenCookiePath string = "/" // Cookie路径 TokenCookieDomain string = "" // Cookie域名 TokenCookieSecure bool = false // Cookie是否只在https时传递 TokenCookieHttpOnly bool = true // Cookie是否限制js访问 AccessTokenDuration time.Duration = time.Second * 60 * 60 * 24 // AccessToken有效期 RefreshTokenDuration time.Duration = time.Second * 60 * 60 * 24 * 7 // RefreshToken有效期 )
View Source
const ( DefaultPageSize = 50 // 默认分页大小 MaxPageSize = 200 // 最大分页 )
View Source
const (
ServiceDiscoveryAddress string = "127.0.0.1:8500" // 服务发现地址
)
Variables ¶
This section is empty.
Functions ¶
func BindAndValid ¶
func GetPageOffset ¶
func GetPageSize ¶
Types ¶
type DingtalkAlert ¶
type DingtalkAlert struct { }
DingtalkAlert 钉钉通知
func NewDingtalkAlert ¶
func NewDingtalkAlert() *DingtalkAlert
func (*DingtalkAlert) Send ¶
func (alert *DingtalkAlert) Send(msg string)
type EmailAlert ¶
type EmailAlert struct { }
EmailAlert 邮件通知
func NewEmailAlert ¶
func NewEmailAlert() *EmailAlert
func (*EmailAlert) Send ¶
func (alert *EmailAlert) Send(msg string)
type Response ¶
func NewResponse ¶
func (*Response) ToErrorResponse ¶
func (*Response) ToResponse ¶
func (r *Response) ToResponse(data interface{})
func (*Response) ToResponseList ¶
type ValidError ¶
func (*ValidError) Error ¶
func (e *ValidError) Error() string
type ValidErrors ¶
type ValidErrors []*ValidError
func (ValidErrors) Error ¶
func (es ValidErrors) Error() string
func (ValidErrors) Errors ¶
func (es ValidErrors) Errors() []string
Click to show internal directories.
Click to hide internal directories.