 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
- func DeleteByName(ctx context.Context, name string) error
- func RouterRegister(r *kit.Router, name, desc string)
- 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 GroupMetaWithPrivilege
- type ListData
- type ListReq
- type ListRsp
- type OperatorMeta
- type UpdateReq
- type UpdateRsp
- 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
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"`
	Privileges   []*GroupMetaWithPrivilege   `json:"privileges"`
	ExpiredAt    *types.Timestamp            `json:"expiredAt,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) ConvToPrivilegeModel ¶ added in v1.4.6
func (gaps GroupAccessPrivileges) ConvToPrivilegeModel() models.GroupAccessPrivileges
type GroupMeta ¶ added in v1.4.6
type GroupMeta struct {
	GroupMetaBase
	Operators map[string]*OperatorMeta
}
    type GroupMetaBase ¶ added in v1.4.6
func OperatorGroupMetaList ¶ added in v1.4.6
func OperatorGroupMetaList() []*GroupMetaBase
type GroupMetaWithPrivilege ¶ added in v1.4.6
type GroupMetaWithPrivilege struct {
	GroupMetaBase
	Perm enums.AccessPermission `json:"perm"`
}
    func ConvToGroupMetaWithPrivileges ¶ added in v1.4.6
func ConvToGroupMetaWithPrivileges(privileges models.GroupAccessPrivileges) []*GroupMetaWithPrivilege
type ListData ¶
type ListData struct {
	Name       string                   `json:"name"`
	ExpiredAt  *types.Timestamp         `json:"expiredAt,omitempty"`
	LastUsed   *types.Timestamp         `json:"lastUsed,omitempty"`
	Privileges []GroupMetaWithPrivilege `json:"privileges,omitempty"`
	Desc       string                   `json:"desc,omitempty"`
	datatypes.OperationTimes
}
    func NewListDataByModel ¶ added in v1.4.6
type OperatorMeta ¶ added in v1.4.6
type OperatorMeta struct {
	OperatorID  string
	Summary     string
	Method      string
	Attr        enums.ApiOperatorAttr
	MinimalPerm enums.AccessPermission
}
    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 UpdateRsp ¶ added in v1.4.6
type UpdateRsp struct {
	Name         string                      `json:"name"`
	IdentityType enums.AccessKeyIdentityType `json:"identityType"`
	IdentityID   types.SFID                  `json:"identityID"`
	Privileges   []*GroupMetaWithPrivilege   `json:"privileges"`
	ExpiredAt    *types.Timestamp            `json:"expiredAt,omitempty"`
	LastUsed     *types.Timestamp            `json:"lastUsed,omitempty"`
	Desc         string                      `json:"desc,omitempty"`
}
    type WithOperatorAttr ¶ added in v1.4.6
type WithOperatorAttr interface {
	OperatorAttr() enums.ApiOperatorAttr
}
     Click to show internal directories. 
   Click to hide internal directories.