Documentation
¶
Index ¶
- func GetTestDSN() string
- type Artifact
- type ChangeRecord
- type Config
- type HistoryStore
- type Postgres
- func (p *Postgres) Close() error
- func (p *Postgres) CreateArtifact(ctx context.Context, artifact *Artifact) error
- func (p *Postgres) CreateTables(ctx context.Context) error
- func (p *Postgres) CreateTenant(ctx context.Context, tenant *Tenant) error
- func (p *Postgres) DeleteArtifact(ctx context.Context, tenantID, container, name string) error
- func (p *Postgres) GetArtifact(ctx context.Context, tenantID, container, name string) (*Artifact, error)
- func (p *Postgres) GetTenant(ctx context.Context, id string) (*Tenant, error)
- func (p *Postgres) ListArtifacts(ctx context.Context, tenantID, container string, limit int) ([]*Artifact, error)
- func (p *Postgres) Ping(ctx context.Context) error
- type Tenant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTestDSN ¶
func GetTestDSN() string
Types ¶
type Artifact ¶
type Artifact struct {
ID int64
TenantID string
Container string
Name string
Size int64
ContentType string
ETag string
CreatedAt time.Time
UpdatedAt time.Time
}
Artifact represents stored artifact metadata
type ChangeRecord ¶
type Config ¶
type Config struct {
Host string
Port int
Database string
User string
Password string
SSLMode string
}
Config holds database configuration
type HistoryStore ¶
type HistoryStore struct {
// contains filtered or unexported fields
}
func NewHistoryStore ¶
func NewHistoryStore(db *sql.DB) *HistoryStore
func (*HistoryStore) GetHistory ¶
func (h *HistoryStore) GetHistory(ctx context.Context, tenantID, container, artifact string) ([]ChangeRecord, error)
func (*HistoryStore) RecordChange ¶
func (h *HistoryStore) RecordChange(ctx context.Context, tenantID, container, artifact, operation string) error
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
Postgres represents a PostgreSQL connection
func NewPostgres ¶
NewPostgres creates a new PostgreSQL connection
func (*Postgres) CreateArtifact ¶
CreateArtifact stores artifact metadata
func (*Postgres) CreateTables ¶
CreateTables creates the necessary database tables
func (*Postgres) CreateTenant ¶
CreateTenant creates a new tenant
func (*Postgres) DeleteArtifact ¶
DeleteArtifact removes artifact metadata
func (*Postgres) GetArtifact ¶
func (p *Postgres) GetArtifact(ctx context.Context, tenantID, container, name string) (*Artifact, error)
GetArtifact retrieves artifact metadata
Click to show internal directories.
Click to hide internal directories.