Documentation
¶
Index ¶
- func DecodeBSON(d interface{}, val interface{}) (err error)
- func DecodeBSONSlice(dSlice []interface{}, val interface{}) (err error)
- func GenerateAccessKey(lengthArg ...uint8) []byte
- func GenerateStringAccessKey(lengthArg ...uint8) string
- func NumKiloString(n uint64) string
- func NumMetaKiloString(n uint64) string
- func NumMetaString(n uint64) string
- func TimeBetween(t time.Time, start *time.Time, end *time.Time) bool
- func TimeDayAt(t time.Time, offset time.Duration) time.Time
- func TimeHourAt(t time.Time) time.Time
- func TimeMinuteAt(t time.Time) time.Time
- func TimeMonthAt(t time.Time, offset time.Duration) time.Time
- func TimeParseAny(value string) (*time.Time, error)
- func TimeSecondAt(t time.Time) time.Time
- type Authorization
- type Clicker
- type ClockGenerator
- type Credential
- func (credential *Credential) AccessKeys() [][]byte
- func (credential *Credential) Append(next *Credential) (newCredential *Credential)
- func (credential *Credential) Attach(next *Credential)
- func (credential *Credential) Clone() *Credential
- func (credential *Credential) ID() []byte
- func (credential *Credential) StringAccessKeys() []string
- func (credential *Credential) StringID() string
- func (credential *Credential) StringToken() string
- func (credential *Credential) Token() []byte
- type CredentialChain
- type KVPairs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBSON ¶
func DecodeBSON(d interface{}, val interface{}) (err error)
DecodeBSON decodes bson type d to object val parameter val must be structure or pointer of structure
func DecodeBSONSlice ¶
func DecodeBSONSlice(dSlice []interface{}, val interface{}) (err error)
DecodeBSONSlice decodes bson type dSlice to object val parameter val must be slice of structure or slice of structure pointer
func GenerateAccessKey ¶
func GenerateStringAccessKey ¶
func NumKiloString ¶
func NumMetaKiloString ¶
func NumMetaString ¶
func TimeBetween ¶
TimeBetween returns true if t is between start and end start=nil means -∞, end=nil means ∞
func TimeHourAt ¶
TimeHourAt returns the result of rounding t down to the nearest multiple of a hour
func TimeMinuteAt ¶
TimeMinuteAt returns the result of rounding t down to the nearest multiple of a minute
func TimeMonthAt ¶
TimeMonthAt returns the result of rounding t down to the nearest multiple of a month
func TimeParseAny ¶
TimeParseAny parses string with any common format to time.Time
Types ¶
type Authorization ¶
type Authorization struct { *Credential // contains filtered or unexported fields }
func NewAuthorization ¶
func NewAuthorization(cred *Credential) *Authorization
func (*Authorization) CheckPermission ¶
func (authorization *Authorization) CheckPermission(perm int32) bool
func (*Authorization) IsAuthorized ¶
func (authorization *Authorization) IsAuthorized() bool
func (*Authorization) PopPermission ¶
func (authorization *Authorization) PopPermission() (perm int32, err error)
func (*Authorization) PushPermission ¶
func (authorization *Authorization) PushPermission(perm int32) (err error)
type ClockGenerator ¶
type ClockGenerator struct {
// contains filtered or unexported fields
}
func NewClockGenerator ¶
func NewClockGenerator(clock Clicker, d time.Duration, bufferSize ...uint16) (clockGenerator *ClockGenerator)
NewClockGenerator returns a new channel type clock pulse generator with given duration and bufferSize
func (*ClockGenerator) Channel ¶
func (clockGenerator *ClockGenerator) Channel() <-chan time.Time
func (*ClockGenerator) Stop ¶
func (clockGenerator *ClockGenerator) Stop()
type Credential ¶
type Credential struct { AccessKey []byte // contains filtered or unexported fields }
func NewCredentialFromKnownAccessKey ¶
func NewCredentialFromKnownAccessKey(accessKey []byte, secretLength ...int) (credential *Credential)
func NewCredentialFromKnownAccessKeyChain ¶
func NewCredentialFromKnownAccessKeyChain(accessKey ...string) (credential *Credential)
func NewCredentialFromKnownStringAccessKey ¶
func NewCredentialFromKnownStringAccessKey(accessKey string, secretLength ...int) (credential *Credential)
func (*Credential) AccessKeys ¶
func (credential *Credential) AccessKeys() [][]byte
func (*Credential) Append ¶
func (credential *Credential) Append(next *Credential) (newCredential *Credential)
func (*Credential) Attach ¶
func (credential *Credential) Attach(next *Credential)
func (*Credential) Clone ¶
func (credential *Credential) Clone() *Credential
func (*Credential) ID ¶
func (credential *Credential) ID() []byte
func (*Credential) StringAccessKeys ¶
func (credential *Credential) StringAccessKeys() []string
func (*Credential) StringID ¶
func (credential *Credential) StringID() string
func (*Credential) StringToken ¶
func (credential *Credential) StringToken() string
func (*Credential) Token ¶
func (credential *Credential) Token() []byte
type CredentialChain ¶
type CredentialChain = *Credential
func CredentialChainFromToken ¶
func CredentialChainFromToken(token []byte, levelParam ...int) CredentialChain