Documentation
¶
Index ¶
- type Config
- type Store
- func (s *Store) Clear(ctx context.Context, namespace []string) error
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, namespace []string, key string) error
- func (s *Store) Get(ctx context.Context, namespace []string, key string) (*store.Value, error)
- func (s *Store) List(ctx context.Context, namespace []string) ([]string, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) Put(ctx context.Context, namespace []string, key string, value interface{}) error
- func (s *Store) Search(ctx context.Context, namespace []string, filter map[string]interface{}) ([]*store.Value, error)
- func (s *Store) Size(ctx context.Context) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DSN is the PostgreSQL Data Source Name
// Example: "host=localhost user=postgres password=secret dbname=agent port=5432 sslmode=disable"
DSN string
// TableName is the name of the table to use for storage
TableName string
// MaxIdleConns is the maximum number of idle connections
MaxIdleConns int
// MaxOpenConns is the maximum number of open connections
MaxOpenConns int
// ConnMaxLifetime is the maximum lifetime of a connection
ConnMaxLifetime time.Duration
// LogLevel is the GORM log level
LogLevel logger.LogLevel
// AutoMigrate enables automatic table creation
AutoMigrate bool
}
Config holds configuration for PostgreSQL store
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns default PostgreSQL configuration
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a PostgreSQL-backed implementation of the store.Store interface.
Features:
- JSONB storage for flexible data types
- Efficient indexing on namespace and key
- ACID compliance for data integrity
- Powerful search with JSONB queries
- Connection pooling
Suitable for:
- Production deployments
- Large-scale data storage
- Complex queries
- Distributed systems with shared database
Click to show internal directories.
Click to hide internal directories.