Documentation
¶
Index ¶
- type DatabaseHandler
- type MinIOStorage
- func (m *MinIOStorage) Close() error
- func (m *MinIOStorage) CreateBucket(ctx context.Context, webhook types.Webhook) error
- func (m *MinIOStorage) DeleteObject(ctx context.Context, bucketName, objectName string) error
- func (m *MinIOStorage) GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error)
- func (m *MinIOStorage) GetObjects(ctx context.Context, bucket string) ([]string, error)
- func (m *MinIOStorage) GetPresignedURL(ctx context.Context, bucketName, objectName string, expires time.Duration) (string, error)
- func (m *MinIOStorage) PutObject(ctx context.Context, bucketName, payload string) error
- type ObjectStoreHandler
- type PostgresDB
- func (p *PostgresDB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
- func (p *PostgresDB) Close() error
- func (p *PostgresDB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (p *PostgresDB) Ping() error
- func (p *PostgresDB) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (p *PostgresDB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseHandler ¶
type DatabaseHandler interface {
// ExecContext executes a query with parameters
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
// QueryContext queries multiple rows
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
// QueryRowContext queries a single row
QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
// BeginTx begins a transaction
BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
// Close connection
Close() error
// Ping can be used to connection health
Ping() error
}
DatabaseHandler defines an interface for database storage operations
type MinIOStorage ¶
type MinIOStorage struct {
// contains filtered or unexported fields
}
func NewMinIOStorage ¶
func NewMinIOStorage(config *config.Config) (*MinIOStorage, error)
NewMinIOStorage creates new MinIO storage instance
func (*MinIOStorage) Close ¶
func (m *MinIOStorage) Close() error
func (*MinIOStorage) CreateBucket ¶
func (*MinIOStorage) DeleteObject ¶
func (m *MinIOStorage) DeleteObject(ctx context.Context, bucketName, objectName string) error
func (*MinIOStorage) GetObject ¶
func (m *MinIOStorage) GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error)
func (*MinIOStorage) GetObjects ¶
func (*MinIOStorage) GetPresignedURL ¶
type ObjectStoreHandler ¶
type ObjectStoreHandler interface {
CreateBucket(ctx context.Context, webhook types.Webhook) error
// PutObject uploads a file to object storage
PutObject(ctx context.Context, bucketName, payload string) error
// GetObject downloads a file from object storage
GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error)
// GetObjects returns a string array of all bucket contents
GetObjects(ctx context.Context, bucketName string) ([]string, error)
// DeleteObject deletes a file from object storage
DeleteObject(ctx context.Context, bucketName, objectName string) error
// GetPresignedURL returns temporary URL for object
GetPresignedURL(ctx context.Context, bucketName, objectName string, expires time.Duration) (string, error)
// Close connection
Close() error
}
ObjectStoreHandler defines an interface for object storage operations
type PostgresDB ¶
type PostgresDB struct {
// contains filtered or unexported fields
}
PostgresDB implements Database interface
func NewPostgresDB ¶
func NewPostgresDB(config *config.Config) (*PostgresDB, error)
NewPostgresDB creates new PostgreSQL database instance
func (*PostgresDB) Close ¶
func (p *PostgresDB) Close() error
func (*PostgresDB) ExecContext ¶
func (*PostgresDB) Ping ¶
func (p *PostgresDB) Ping() error
func (*PostgresDB) QueryContext ¶
func (*PostgresDB) QueryRowContext ¶
Click to show internal directories.
Click to hide internal directories.