Documentation ¶
Index ¶
- func BooleanClaim(key string, fetchValue FetchValueFunc, defaultMaxAgeInSeconds *int64) (*TypeSessionClaim, BooleanClaimValidators)
- func PrimitiveArrayClaim(key string, fetchValue FetchValueFunc, defaultMaxAgeInSeconds *int64) (*TypeSessionClaim, PrimitiveArrayClaimValidators)
- func PrimitiveClaim(key string, fetchValue FetchValueFunc, defaultMaxAgeInSeconds *int64) (*TypeSessionClaim, PrimitiveClaimValidators)
- type BooleanClaimValidators
- type ClaimValidationError
- type ClaimValidationResult
- type FetchValueFunc
- type PrimitiveArrayClaimValidators
- type PrimitiveClaimValidators
- type SessionClaimValidator
- type TypeSessionClaim
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BooleanClaim ¶
func BooleanClaim(key string, fetchValue FetchValueFunc, defaultMaxAgeInSeconds *int64) (*TypeSessionClaim, BooleanClaimValidators)
func PrimitiveArrayClaim ¶
func PrimitiveArrayClaim(key string, fetchValue FetchValueFunc, defaultMaxAgeInSeconds *int64) (*TypeSessionClaim, PrimitiveArrayClaimValidators)
func PrimitiveClaim ¶
func PrimitiveClaim(key string, fetchValue FetchValueFunc, defaultMaxAgeInSeconds *int64) (*TypeSessionClaim, PrimitiveClaimValidators)
Types ¶
type BooleanClaimValidators ¶
type BooleanClaimValidators struct { PrimitiveClaimValidators IsTrue func(maxAgeInSeconds *int64, id *string) SessionClaimValidator IsFalse func(maxAgeInSeconds *int64, id *string) SessionClaimValidator }
type ClaimValidationError ¶
type ClaimValidationError struct { ID string `json:"id"` Reason interface{} `json:"reason,omitempty"` // This can be nil, add checks when used }
type ClaimValidationResult ¶
type ClaimValidationResult struct { IsValid bool Reason interface{} // This can be nil, add checks when used }
type FetchValueFunc ¶
type FetchValueFunc func(userId string, userContext supertokens.UserContext) (interface{}, error)
type PrimitiveArrayClaimValidators ¶
type PrimitiveArrayClaimValidators struct { Includes func(val interface{}, maxAgeInSeconds *int64, id *string) SessionClaimValidator Excludes func(val interface{}, maxAgeInSeconds *int64, id *string) SessionClaimValidator IncludesAll func(vals []interface{}, maxAgeInSeconds *int64, id *string) SessionClaimValidator ExcludesAll func(vals []interface{}, maxAgeInSeconds *int64, id *string) SessionClaimValidator }
type PrimitiveClaimValidators ¶
type PrimitiveClaimValidators struct {
HasValue func(val interface{}, maxAgeInSeconds *int64, id *string) SessionClaimValidator
}
type SessionClaimValidator ¶
type SessionClaimValidator struct { ID string Claim *TypeSessionClaim ShouldRefetch func(payload map[string]interface{}, userContext supertokens.UserContext) bool Validate func(payload map[string]interface{}, userContext supertokens.UserContext) ClaimValidationResult }
type TypeSessionClaim ¶
type TypeSessionClaim struct { Key string FetchValue FetchValueFunc AddToPayload_internal func(payload map[string]interface{}, value interface{}, userContext supertokens.UserContext) map[string]interface{} RemoveFromPayloadByMerge_internal func(payload map[string]interface{}, userContext supertokens.UserContext) map[string]interface{} RemoveFromPayload func(payload map[string]interface{}, userContext supertokens.UserContext) map[string]interface{} GetValueFromPayload func(payload map[string]interface{}, userContext supertokens.UserContext) interface{} Build func(userId string, payloadToUpdate map[string]interface{}, userContext supertokens.UserContext) (map[string]interface{}, error) }
func SessionClaim ¶
func SessionClaim(key string, fetchValue FetchValueFunc) *TypeSessionClaim
Click to show internal directories.
Click to hide internal directories.