postgres

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(connURL string) error

Migrate to run up migrations

func NewHTTPFSMigrator

func NewHTTPFSMigrator(DBConnURL string) (*migrate.Migrate, error)

NewHTTPFSMigrator reads the migrations from httpfs and returns the migrate.Migrate

Types

type DB

type DB struct {
	*pgxpool.Pool
}

DB represents postgres database instance

func NewStore

func NewStore(conn string) *DB

NewStore create a postgres store

type NamespaceRepository

type NamespaceRepository struct {
	// contains filtered or unexported fields
}

func NewNamespaceRepository

func NewNamespaceRepository(dbc *DB) *NamespaceRepository

func (*NamespaceRepository) Create

func (*NamespaceRepository) Delete

func (r *NamespaceRepository) Delete(ctx context.Context, id string) error

func (*NamespaceRepository) Get

func (*NamespaceRepository) List

func (*NamespaceRepository) Update

type NotificationEventRepository added in v0.8.0

type NotificationEventRepository struct {
	// contains filtered or unexported fields
}

func NewNotificationEventRepository added in v0.8.0

func NewNotificationEventRepository(dbc *DB) *NotificationEventRepository

func (*NotificationEventRepository) Create added in v0.8.0

func (*NotificationEventRepository) GetByNameSpaceSchemaVersionAndSuccess added in v0.8.0

func (r *NotificationEventRepository) GetByNameSpaceSchemaVersionAndSuccess(ctx context.Context, namespace string, schemaID int32, versionID string, success bool) (changedetector.NotificationEvent, error)

func (*NotificationEventRepository) Update added in v0.8.0

type SchemaRepository

type SchemaRepository struct {
	// contains filtered or unexported fields
}

func NewSchemaRepository

func NewSchemaRepository(dbc *DB) *SchemaRepository

func (*SchemaRepository) Create

func (r *SchemaRepository) Create(ctx context.Context, namespace string, schemaName string, metadata *schema.Metadata, versionID string, file *schema.SchemaFile) (int32, error)

func (*SchemaRepository) Delete

func (r *SchemaRepository) Delete(ctx context.Context, ns string, sc string) error

func (*SchemaRepository) DeleteVersion

func (r *SchemaRepository) DeleteVersion(ctx context.Context, ns string, sc string, version int32) error

func (*SchemaRepository) Get

func (r *SchemaRepository) Get(ctx context.Context, namespaceId, schemaName string, versionNumber int32) ([]byte, error)

func (*SchemaRepository) GetLatestVersion

func (r *SchemaRepository) GetLatestVersion(ctx context.Context, namespaceId, schemaName string) (int32, error)

func (*SchemaRepository) GetMetadata

func (r *SchemaRepository) GetMetadata(ctx context.Context, namespace, sc string) (*schema.Metadata, error)

func (*SchemaRepository) GetSchemaID added in v0.8.0

func (r *SchemaRepository) GetSchemaID(ctx context.Context, ns string, sc string) (int32, error)

func (*SchemaRepository) List

func (r *SchemaRepository) List(ctx context.Context, namespaceID string) ([]schema.Schema, error)

func (*SchemaRepository) ListVersions

func (r *SchemaRepository) ListVersions(ctx context.Context, ns string, sc string) ([]int32, error)

func (*SchemaRepository) UpdateMetadata

func (r *SchemaRepository) UpdateMetadata(ctx context.Context, namespace, sc string, in *schema.Metadata) (*schema.Metadata, error)

type SearchRepository

type SearchRepository struct {
	// contains filtered or unexported fields
}

func NewSearchRepository

func NewSearchRepository(dbc *DB) *SearchRepository

func (*SearchRepository) Search

func (*SearchRepository) SearchLatest

func (r *SearchRepository) SearchLatest(ctx context.Context, req *search.SearchRequest) ([]*search.SearchHits, error)

Jump to

Keyboard shortcuts

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