Versions in this module Expand all Collapse all v1 v1.1.0 Mar 21, 2022 v1.0.1 Mar 21, 2022 Changes in this version + func DefaultAuthRequestOptions() authRequestOptions + type ACL interface + PublishAble func(userName string, topicPattern string) + SubcribeAble func(userName string, topicPattern string) + type Auth interface + Check func(ctx context.Context, req *AuthRequest, options ...AuthRequestOption) (bool, error) + MotionExpired func(fc func(userName, clientId string) error) error + Update func(ctx context.Context, req *AuthRequest, options ...AuthRequestOption) error + type AuthDiscardPolicy int + const AuthDiscardNew + const AuthDiscardOld + type AuthRequest struct + ClientId string + ClientIp string + PassWord string + TlsServerName string + TlsSubjectName string + UserName string + type AuthRequestOption func(*authRequestOptions) error + func WithAuthRequestDiscardPolicy(val AuthDiscardPolicy) AuthRequestOption + func WithAuthRequestMaxTokens(val uint64) AuthRequestOption + func WithAuthRequestTtl(ttl time.Duration) AuthRequestOption + type ErrAuthInvalid error + var ErrAuthInvalidClientIP ErrAuthInvalid = errors.New("mqx: auth failed, Invalid clientIP") + var ErrAuthInvalidClientId ErrAuthInvalid = errors.New("mqx: auth failed, Invalid clientID") + var ErrAuthInvalidExpired ErrAuthInvalid = errors.New("mqx: auth failed, Token expired") + var ErrAuthInvalidTooManyTokens ErrAuthInvalid = errors.New("mqx: auth failed, too many tokens") + var ErrAuthInvalidUserNamePassword ErrAuthInvalid = errors.New("mqx: auth failed, Invalid username or password") + var ErrAuthServiceUnviable ErrAuthInvalid = errors.New("mqx: auth faild, Service unavailable")