postgresqlcache

package module
v4.1.5-0...-f4b7d91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

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) Clear

func (s *PostgresqlStore) Clear(ctx context.Context) error

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) Get

func (s *PostgresqlStore) Get(ctx context.Context, key any) (any, error)

Get returns data stored from a given key

func (*PostgresqlStore) GetType

func (s *PostgresqlStore) GetType() string

GetType returns the store type

func (*PostgresqlStore) GetWithTTL

func (s *PostgresqlStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)

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

func (*PostgresqlStore) Set

func (s *PostgresqlStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL