Documentation ¶
Index ¶
- type Cache
- func (r *Cache) DeleteDraft(ctx goContext.Context, draftId string) error
- func (r *Cache) FlushAll(ctx goContext.Context) error
- func (r *Cache) GetDraft(ctx goContext.Context, draftId string) (string, error)
- func (r *Cache) GetDrafts(ctx goContext.Context) (map[string]string, error)
- func (r *Cache) GetUserId(ctx goContext.Context, token string) (int, error)
- func (r *Cache) IncrementTestInvoiceCounter(ctx goContext.Context, userId int) (int, error)
- func (r *Cache) RemoveUserToken(ctx goContext.Context, token string) error
- func (r *Cache) SaveDraft(ctx goContext.Context, draftId, name string) error
- func (r *Cache) SaveJti(ctx goContext.Context, userId int, jti string, expiration time.Duration) error
- func (r *Cache) SaveUserToken(ctx goContext.Context, token string, userId int) error
- type Configuration
- type JtiExistsError
- type NotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func NewRedis ¶
func NewRedis(cacheConfig Configuration) *Cache
func (*Cache) DeleteDraft ¶
func (*Cache) IncrementTestInvoiceCounter ¶
Increments test invoice counter for user and returns it's new value. If counter doesn't exist new counter is created with value 1 and expiration 24 hours.
func (*Cache) RemoveUserToken ¶
type Configuration ¶
type Configuration struct { Host string Port int Password string SessionTokenExpiration time.Duration TestInvoiceRateLimiterExpiration time.Duration TestInvoiceRateLimiterThreshold int }
func NewConfig ¶
func NewConfig(defaultConfig Configuration) Configuration
type JtiExistsError ¶
type JtiExistsError struct {
// contains filtered or unexported fields
}
func (*JtiExistsError) Error ¶
func (e *JtiExistsError) Error() string
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.