Documentation
¶
Index ¶
- Constants
- type PostgresqlStore
- func (s *PostgresqlStore) Clear(ctx context.Context) error
- func (s *PostgresqlStore) Close(ctx context.Context) error
- func (s *PostgresqlStore) Delete(ctx context.Context, key any) error
- func (s *PostgresqlStore) Get(ctx context.Context, key any) (any, error)
- func (s *PostgresqlStore) GetType() string
- func (s *PostgresqlStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)
- func (s *PostgresqlStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
- func (s *PostgresqlStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error
Constants ¶
View Source
const (
// PostgresqlCacheType represents the storage type as a string value
PostgresqlCacheType = "postgresql"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresqlStore ¶
type PostgresqlStore struct {
// contains filtered or unexported fields
}
PostgresqlStore is a store for Redis
func NewPostgresqlStore ¶
func NewPostgresqlStore(connString string, options ...lib_store.Option) (*PostgresqlStore, error)
NewPostgresqlStore creates a new store to Redis instance(s) connString: postgres://username:password@localhost:5432/database_name?sslmode=disable&pool_max_conns=30&pool_min_conns=10&pool_health_check_period=30s
func (*PostgresqlStore) Close ¶
func (s *PostgresqlStore) Close(ctx context.Context) error
Close when exit store
func (*PostgresqlStore) Delete ¶
func (s *PostgresqlStore) Delete(ctx context.Context, key any) error
func (*PostgresqlStore) GetType ¶
func (s *PostgresqlStore) GetType() string
GetType returns the store type
func (*PostgresqlStore) GetWithTTL ¶
GetWithTTL returns data stored from a given key and its corresponding TTL
func (*PostgresqlStore) Invalidate ¶
func (s *PostgresqlStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
Click to show internal directories.
Click to hide internal directories.