Documentation ¶
Index ¶
- type RedisBackend
- func (b *RedisBackend) Delete(c context.Context, identifier string) error
- func (b *RedisBackend) Retrieve(c context.Context, identifier string) ([]byte, error)
- func (b *RedisBackend) Save(c context.Context, identifier string, data []byte) error
- func (b *RedisBackend) SaveTTL(c context.Context, identifier string, data []byte, ttl time.Duration) error
- type SQLiteBackend
- func (s *SQLiteBackend) Delete(c context.Context, identifier string) error
- func (s *SQLiteBackend) Retrieve(c context.Context, identifier string) ([]byte, error)
- func (s *SQLiteBackend) Save(c context.Context, identifier string, data []byte) error
- func (s *SQLiteBackend) SaveTTL(c context.Context, identifier string, data []byte, ttl time.Duration) error
- type SQLiteData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisBackend ¶
type RedisBackend struct {
// contains filtered or unexported fields
}
RedisBackend implements app.Backend to provide simple KV storage
func NewRedisBackend ¶
func NewRedisBackend(url string) (*RedisBackend, error)
NewRedisBackend returns a redis backed storage for the application
func (*RedisBackend) Delete ¶
func (b *RedisBackend) Delete(c context.Context, identifier string) error
type SQLiteBackend ¶
type SQLiteBackend struct {
// contains filtered or unexported fields
}
SQLiteBackend implements app.Backend to persist KV data
func NewSQLiteBackend ¶
func NewSQLiteBackend(dbPath string) (*SQLiteBackend, error)
NewSQLiteBackend returns a SQLite backend for the application
func (*SQLiteBackend) Delete ¶
func (s *SQLiteBackend) Delete(c context.Context, identifier string) error
type SQLiteData ¶
type SQLiteData struct { ID string `gorm:"primaryKey"` Data []byte Created time.Time Expires time.Time }
SQLiteData is the data model for storing bytes in SQLite
func (SQLiteData) TableName ¶
func (SQLiteData) TableName() string
TableName is used for gorm.io only, overwriting the default table name
Click to show internal directories.
Click to hide internal directories.