Documentation ¶
Index ¶
- Variables
- func DeleteByName(ctx context.Context, name string) error
- func GenAccessKey(id types.SFID) (rand, key string, ts time.Time)
- func ParseAccessKey(key string) (id types.SFID, rand string, ts time.Time, err error)
- func Validate(ctx context.Context, key string) (interface{}, error, bool)
- type CreateReq
- type CreateRsp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMsgAccessKeyInvalidPartCountOrPrefix = errors.New("invalid part count or prefix") ErrMsgAccessKeyBase64Decode = errors.New("base64 decode") ErrMsgAccessKeyInvalidPartCount = errors.New("invalid part count of contents") ErrMsgAccessKeyInvalidAccountID = errors.New("invalid account id") ErrMsgAccessKeyInvalidTimestamp = errors.New("invalid timestamp") )
Functions ¶
func GenAccessKey ¶
GenAccessKey key contains token owner, random string and generate time
func ParseAccessKey ¶
ParseAccessKey parse access key
Types ¶
type CreateReq ¶
type CreateReq 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"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.