Documentation
¶
Index ¶
- func ContextWithSigner(ctx context.Context, val Signer) context.Context
- func ContextWithVerifier(ctx context.Context, val Verifier) context.Context
- func Sign(ctx context.Context, expiresAt time.Time, customClaims Claims) (token string, err error)
- func SignWithPrefix(ctx context.Context, expiresAt time.Time, customClaims Claims, ...) (token string, err error)
- func VerifyWithPrefix(ctx context.Context, token string, allowed []TypeVersion) (typeVersion TypeVersion, claims Claims, err error)
- type Claims
- type Signer
- type TypeVersion
- type Verifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithVerifier ¶
func SignWithPrefix ¶
func VerifyWithPrefix ¶
func VerifyWithPrefix(ctx context.Context, token string, allowed []TypeVersion) (typeVersion TypeVersion, claims Claims, err error)
Types ¶
type Signer ¶
type Signer interface {
Sign(ctx context.Context, expiresAt time.Time, customClaims Claims) (token string, err error)
}
func ContextSigner ¶
type TypeVersion ¶
func TypeVersionFromString ¶
func TypeVersionFromString(in string) (tv TypeVersion, ok bool)
func (TypeVersion) String ¶
func (p TypeVersion) String() string
Click to show internal directories.
Click to hide internal directories.