Documentation
¶
Index ¶
- func RandomFloat32() float32
- func RandomFloat64() float64
- func RandomInteger(max *big.Int) *big.Int
- func RandomString(enc *EncodingScheme, strLen uint, charSubset *string) (string, error)
- func RandomUint32(max uint32) uint32
- func RandomUint64(max uint64) uint64
- type AccountManager
- type AuthenticationAdapter
- type Digest
- type EncodingScheme
- type Key
- type KeyPair
- type OTP
- type ProviderType
- type SID
- type Session
- type SessionManager
- type Time
- type Token
- type TokenMaker
- type UID
- type User
- type UserData
- type UserProfile
- type UserStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomFloat32 ¶
func RandomFloat32() float32
Generates a random 32 bit floating number between 0 and 1. The function uses the crypto/rand package to generate 23 random bits for the mantissa
func RandomFloat64 ¶
func RandomFloat64() float64
Generates a random 64 bit floating number between 0 and 1. The function uses the crypto/rand package to generate 52 random bits for the mantissa
func RandomInteger ¶
Generates a random integer value of arbitrary size that is less than the given max value. The function uses a rejection sampling technique based on comparing the random value after it is bit shifted with the max value.
func RandomString ¶
func RandomString(enc *EncodingScheme, strLen uint, charSubset *string) (string, error)
Generates either a base10, 16, 32 or 64 encoded string of the specified length. The charSubset parameter is used when the encoding scheme is base32 or base64. It allows the user to specify a custom character set for the encoding. If charSubset is nil, the default encoding scheme will be used.
func RandomUint32 ¶
Generates a random unsigned 32bit integer between [0, max). `max` should not be a very large number.
func RandomUint64 ¶
Generates a random unsigned 32bit integer between [0, max). `max` should not be a very large number.
Types ¶
type AccountManager ¶
type AuthenticationAdapter ¶
type AuthenticationAdapter interface {
TokenMaker
SessionManager
AccountManager
}
type Digest ¶
type Digest string
Digest is a primitive of the string data type representing a hash digest.
type EncodingScheme ¶
type EncodingScheme string
const ( HEX EncodingScheme = "hex" B32 EncodingScheme = "base32" B64 EncodingScheme = "base64" B10 EncodingScheme = "base10" )
type Key ¶
type Key string
Key is a primitive of the string data type representing a secret key.
func GenerateSecret ¶
GenerateSecret generates a random secret key of the specified size in bytes.
type ProviderType ¶
type ProviderType string
const ( OIDCIDP ProviderType = "oidc" SAMLIDP ProviderType = "saml" LDAPIDP ProviderType = "ldap" LocalCredIDP ProviderType = "local" OtherIDP ProviderType = "other" )
type SessionManager ¶
type Time ¶
Time is a primitive of the time data type representing a duration in nanoseconds.
func (Time) MarshalJSON ¶
MarshalJSON implements json.Marshaler to convert Time to json serialization.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler to deserialize json data.
type TokenMaker ¶
type User ¶
type User interface {
ID() UID
Status() UserStatus
DisplayName() string
}
type UserProfile ¶
type UserProfile interface {
ID() string
UserId() UID
IdPType() ProviderType
IdPName() string
IdPAccountId() string
}
type UserStatus ¶
type UserStatus int
const ( UNKNOWN UserStatus = iota ACTIVE PENDING DISABLED ARCHIVED )