Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBase64Handler ¶
func NewBase64Handler() base64Handler
func NewRedisHandler ¶
func NewRedisHandler() *redisHandler
Types ¶
type Handler ¶
type Handler interface { Encrypt(SubscriptionData) (Token, error) Decrypt(Token) (SubscriptionData, error) }
Handler converts between SuscriptionData and Token
type KeyValueStore ¶
type MemoryHandler ¶
type MemoryHandler struct {
// contains filtered or unexported fields
}
func NewMemoryHandler ¶
func NewMemoryHandler() *MemoryHandler
func (*MemoryHandler) Decrypt ¶
func (h *MemoryHandler) Decrypt(t Token) (SubscriptionData, error)
func (*MemoryHandler) Encrypt ¶
func (h *MemoryHandler) Encrypt(sd SubscriptionData) (Token, error)
type StringToken ¶
type StringToken struct {
Token string
}
StringToken represents the Token as a string
func (StringToken) String ¶
func (s StringToken) String() string
type SubscriptionData ¶
SubscriptionData represents the data for a single user subscription
func (SubscriptionData) Equal ¶
func (sd SubscriptionData) Equal(u SubscriptionData) bool
Equal returns true if a two instances of SubscriptionData are equal to each other It is necessary due to the fact that ExpiresAt cannot be reliably compared with ==
Click to show internal directories.
Click to hide internal directories.