Documentation
¶
Overview ¶
Package postgres provides PostgreSQL storage implementation for CVT.
Index ¶
- type PostgresStore
- func (s *PostgresStore) Close() error
- func (s *PostgresStore) DeleteSchema(ctx context.Context, schemaID string) error
- func (s *PostgresStore) DeleteSchemaVersion(ctx context.Context, schemaID, version string) error
- func (s *PostgresStore) DeregisterConsumer(ctx context.Context, consumerID, schemaID, environment string) error
- func (s *PostgresStore) GetComparison(ctx context.Context, schemaID, oldVersion, newVersion string) (*storage.ComparisonRecord, error)
- func (s *PostgresStore) GetConsumer(ctx context.Context, consumerID, schemaID, environment string) (*storage.ConsumerRecord, error)
- func (s *PostgresStore) GetPreviousVersion(ctx context.Context, schemaID, currentVersion string) (string, error)
- func (s *PostgresStore) GetSchema(ctx context.Context, schemaID string) (*storage.SchemaRecord, error)
- func (s *PostgresStore) GetSchemaVersion(ctx context.Context, schemaID, version string) (*storage.SchemaRecord, error)
- func (s *PostgresStore) GetValidationAnalytics(ctx context.Context, filter storage.ListValidationsFilter) (*storage.ValidationAnalytics, error)
- func (s *PostgresStore) ListConsumers(ctx context.Context, filter storage.ListConsumersFilter) ([]*storage.ConsumerRecord, error)
- func (s *PostgresStore) ListSchemaIDs(ctx context.Context) ([]string, error)
- func (s *PostgresStore) ListSchemas(ctx context.Context, filter storage.ListSchemasFilter) ([]*storage.SchemaRecord, string, int32, error)
- func (s *PostgresStore) ListValidations(ctx context.Context, filter storage.ListValidationsFilter) ([]*storage.ValidationRecord, string, error)
- func (s *PostgresStore) ListVersions(ctx context.Context, schemaID string) ([]string, error)
- func (s *PostgresStore) Migrate(ctx context.Context) error
- func (s *PostgresStore) Ping(ctx context.Context) error
- func (s *PostgresStore) RecordComparison(ctx context.Context, record *storage.ComparisonRecord) error
- func (s *PostgresStore) RecordValidation(ctx context.Context, record *storage.ValidationRecord) error
- func (s *PostgresStore) RegisterConsumer(ctx context.Context, record *storage.ConsumerRecord) error
- func (s *PostgresStore) SetSchema(ctx context.Context, record *storage.SchemaRecord) error
- func (s *PostgresStore) UpdateConsumerValidation(ctx context.Context, consumerID, schemaID, environment string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
PostgresStore implements storage.Store using PostgreSQL.
func (*PostgresStore) Close ¶
func (s *PostgresStore) Close() error
Close closes the database connection pool.
func (*PostgresStore) DeleteSchema ¶
func (s *PostgresStore) DeleteSchema(ctx context.Context, schemaID string) error
DeleteSchema removes all versions of a schema.
func (*PostgresStore) DeleteSchemaVersion ¶
func (s *PostgresStore) DeleteSchemaVersion(ctx context.Context, schemaID, version string) error
DeleteSchemaVersion removes a specific version of a schema.
func (*PostgresStore) DeregisterConsumer ¶
func (s *PostgresStore) DeregisterConsumer(ctx context.Context, consumerID, schemaID, environment string) error
DeregisterConsumer removes a consumer registration.
func (*PostgresStore) GetComparison ¶
func (s *PostgresStore) GetComparison(ctx context.Context, schemaID, oldVersion, newVersion string) (*storage.ComparisonRecord, error)
GetComparison retrieves a stored comparison.
func (*PostgresStore) GetConsumer ¶
func (s *PostgresStore) GetConsumer(ctx context.Context, consumerID, schemaID, environment string) (*storage.ConsumerRecord, error)
GetConsumer retrieves a consumer registration.
func (*PostgresStore) GetPreviousVersion ¶
func (s *PostgresStore) GetPreviousVersion(ctx context.Context, schemaID, currentVersion string) (string, error)
GetPreviousVersion returns the version before the current one.
func (*PostgresStore) GetSchema ¶
func (s *PostgresStore) GetSchema(ctx context.Context, schemaID string) (*storage.SchemaRecord, error)
GetSchema retrieves the latest version of a schema.
func (*PostgresStore) GetSchemaVersion ¶
func (s *PostgresStore) GetSchemaVersion(ctx context.Context, schemaID, version string) (*storage.SchemaRecord, error)
GetSchemaVersion retrieves a specific version of a schema.
func (*PostgresStore) GetValidationAnalytics ¶
func (s *PostgresStore) GetValidationAnalytics(ctx context.Context, filter storage.ListValidationsFilter) (*storage.ValidationAnalytics, error)
GetValidationAnalytics returns aggregated validation statistics.
func (*PostgresStore) ListConsumers ¶
func (s *PostgresStore) ListConsumers(ctx context.Context, filter storage.ListConsumersFilter) ([]*storage.ConsumerRecord, error)
ListConsumers returns consumers matching the filter.
func (*PostgresStore) ListSchemaIDs ¶
func (s *PostgresStore) ListSchemaIDs(ctx context.Context) ([]string, error)
ListSchemaIDs returns all unique schema IDs.
func (*PostgresStore) ListSchemas ¶
func (s *PostgresStore) ListSchemas(ctx context.Context, filter storage.ListSchemasFilter) ([]*storage.SchemaRecord, string, int32, error)
ListSchemas returns schemas matching the filter.
func (*PostgresStore) ListValidations ¶
func (s *PostgresStore) ListValidations(ctx context.Context, filter storage.ListValidationsFilter) ([]*storage.ValidationRecord, string, error)
ListValidations returns validation runs matching the filter.
func (*PostgresStore) ListVersions ¶
ListVersions returns all versions of a schema.
func (*PostgresStore) Migrate ¶
func (s *PostgresStore) Migrate(ctx context.Context) error
Migrate runs database migrations.
func (*PostgresStore) Ping ¶
func (s *PostgresStore) Ping(ctx context.Context) error
Ping verifies database connectivity.
func (*PostgresStore) RecordComparison ¶
func (s *PostgresStore) RecordComparison(ctx context.Context, record *storage.ComparisonRecord) error
RecordComparison stores a schema comparison.
func (*PostgresStore) RecordValidation ¶
func (s *PostgresStore) RecordValidation(ctx context.Context, record *storage.ValidationRecord) error
RecordValidation stores a validation run.
func (*PostgresStore) RegisterConsumer ¶
func (s *PostgresStore) RegisterConsumer(ctx context.Context, record *storage.ConsumerRecord) error
RegisterConsumer stores or updates a consumer registration.
func (*PostgresStore) SetSchema ¶
func (s *PostgresStore) SetSchema(ctx context.Context, record *storage.SchemaRecord) error
SetSchema stores or updates a schema record.
func (*PostgresStore) UpdateConsumerValidation ¶
func (s *PostgresStore) UpdateConsumerValidation(ctx context.Context, consumerID, schemaID, environment string, validatedAt time.Time) error
UpdateConsumerValidation updates the last validated timestamp for a consumer.