Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Confirmation ¶
type Confirmation struct {
ID ulid.ULID `msgpack:"id"`
Secret string `msgpack:"secret"`
ExpiresAt time.Time `msgpack:"expires_at"`
}
Confirmation protects access to a resource by encoding an ID with a cryptographically secure secret and an expiration time.
func (*Confirmation) Create ¶
func (t *Confirmation) Create() (_ string, err error)
Create a new base64 encoded string from the token data. Note that callers should use the NewResourceToken method to ensure that all fields are present; this method is primarily exposed for the tests.
func (*Confirmation) Decode ¶
func (t *Confirmation) Decode(token string) (err error)
Decode a base64 encoded string into the struct.
func (*Confirmation) IsExpired ¶
func (t *Confirmation) IsExpired() bool
Click to show internal directories.
Click to hide internal directories.