Documentation
¶
Index ¶
- Variables
- func DeleteByName(ctx context.Context, name string) error
- func RouterRegister(r *kit.Router, name, desc string)
- func UpdateByName(ctx context.Context, name string, r *UpdateReq) error
- func Validate(ctx context.Context, key string) (interface{}, error, bool)
- type AccessKeyContext
- type CondArgs
- type CreateAccountAccessKeyReq
- type CreateReq
- type CreateReqBase
- type CreateRsp
- type GroupAccessPrivilege
- type GroupAccessPrivileges
- type GroupMeta
- type GroupMetaBase
- type ListData
- type ListReq
- type ListRsp
- type OperatorMeta
- type UpdateReq
- type WithOperatorAttr
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidPrefixOrPartCount = errors.New("invalid prefix or part count") ErrBase64DecodeFailed = errors.New("base64 decode failed") ErrInvalidContentsPartCount = errors.New("invalid part count of contents") ErrParseVersionFailed = errors.New("parse version failed") ErrParseGenTsFailed = errors.New("parse generate ts failed") ErrInvalidVersion = errors.New("invalid version") )
Functions ¶
func RouterRegister ¶ added in v1.4.6
func UpdateByName ¶ added in v1.4.6
Types ¶
type AccessKeyContext ¶
type AccessKeyContext struct {
// Version integer version fixed field
Version int
// GenTS access key generated timestamp (utc,seconds)
GenTS time.Time
// Rand random part, length: gAccessKeyRandLength
Rand string
}
func NewAccessKeyContext ¶
func NewAccessKeyContext(version int) *AccessKeyContext
func NewDefaultAccessKeyContext ¶
func NewDefaultAccessKeyContext() *AccessKeyContext
func (*AccessKeyContext) Equal ¶
func (c *AccessKeyContext) Equal(v *AccessKeyContext) bool
func (AccessKeyContext) MarshalText ¶
func (c AccessKeyContext) MarshalText() ([]byte, error)
func (*AccessKeyContext) Regenerate ¶
func (c *AccessKeyContext) Regenerate()
func (*AccessKeyContext) UnmarshalText ¶
func (c *AccessKeyContext) UnmarshalText(data []byte) (err error)
type CondArgs ¶
type CondArgs struct {
AccountID types.SFID `name:"-"`
Names []string `in:"query" name:"name,omitempty"`
ExpiredAtBegin types.Timestamp `in:"query" name:"expiredAtBegin,omitempty"`
ExpiredAtEnd types.Timestamp `in:"query" name:"expiredAtEnd,omitempty"`
IdentityIDs types.SFIDs `in:"query" name:"identityID,omitempty"`
IdentityTypes []enums.AccessKeyIdentityType `in:"query" name:"identityType,omitempty"`
}
func (*CondArgs) Condition ¶
func (r *CondArgs) Condition() builder.SqlCondition
type CreateAccountAccessKeyReq ¶
type CreateAccountAccessKeyReq = CreateReqBase
type CreateReq ¶
type CreateReq struct {
// IdentityID associated with a publisher, an account or other application
IdentityID types.SFID `json:"identityID,omitempty"`
// IdentityType associated type, default associated current account
IdentityType enums.AccessKeyIdentityType `json:"identityType,default='1'"`
CreateReqBase
}
type CreateReqBase ¶
type CreateReqBase struct {
// Name access token name
Name string `json:"name"`
// ExpirationDays access token valid in ExpirationDays, if 0 means token will not be expired.
ExpirationDays int `json:"expirationDays,omitempty"`
// Description access token description
Desc string `json:"desc,omitempty"`
// Privileges operator group access privileges
Privileges GroupAccessPrivileges `json:"privileges,omitempty"`
}
type CreateRsp ¶
type CreateRsp struct {
Name string `json:"name"`
IdentityType enums.AccessKeyIdentityType `json:"identityType"`
IdentityID types.SFID `json:"identityID"`
AccessKey string `json:"accessKey"`
ExpiredAt *types.Timestamp `json:"expiredAt,omitempty"`
LastUsed *types.Timestamp `json:"lastUsed,omitempty"`
Desc string `json:"desc,omitempty"`
}
type GroupAccessPrivilege ¶ added in v1.4.6
type GroupAccessPrivilege struct {
Name string `json:"name"`
Perm enums.AccessPermission `json:"perm"`
}
type GroupAccessPrivileges ¶ added in v1.4.6
type GroupAccessPrivileges []GroupAccessPrivilege
func (GroupAccessPrivileges) AccessPrivileges ¶
func (gaps GroupAccessPrivileges) AccessPrivileges() models.AccessPrivileges
type GroupMeta ¶ added in v1.4.6
type GroupMeta struct {
GroupMetaBase
Operators []*OperatorMeta
}
type GroupMetaBase ¶ added in v1.4.6
func OperatorGroupMetaList ¶ added in v1.4.6
func OperatorGroupMetaList() []*GroupMetaBase
type OperatorMeta ¶ added in v1.4.6
type OperatorMeta struct {
OperatorID string
Summary string
Method string
Attr enums.ApiOperatorAttr
}
type UpdateReq ¶ added in v1.4.6
type UpdateReq struct {
ExpirationDays int `json:"expirationDays,omitempty"`
Desc string `json:"desc,omitempty"`
Privileges GroupAccessPrivileges `json:"privileges,omitempty"`
}
type WithOperatorAttr ¶ added in v1.4.6
type WithOperatorAttr interface {
OperatorAttr() enums.ApiOperatorAttr
}
Click to show internal directories.
Click to hide internal directories.