undine

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDuplicationError

func IsDuplicationError(err error) bool

Types

type ContextExecutor

type ContextExecutor interface {
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
}

type Deduplicator

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

func NewDeduplicator

func NewDeduplicator(db ContextExecutor, tableName string, schemaAdapter DeduplicatorSchemaAdapter) *Deduplicator

func (*Deduplicator) Deduplicate

func (d *Deduplicator) Deduplicate(ctx context.Context, topic string, id uuid.UUID) error

func (*Deduplicator) InitializeSchema

func (d *Deduplicator) InitializeSchema(ctx context.Context) error

type DeduplicatorPostgresSchemaAdapter

type DeduplicatorPostgresSchemaAdapter struct{}

func (DeduplicatorPostgresSchemaAdapter) InitializeSchemaQuery

func (a DeduplicatorPostgresSchemaAdapter) InitializeSchemaQuery(tableName string) string

func (DeduplicatorPostgresSchemaAdapter) InsertQuery

func (a DeduplicatorPostgresSchemaAdapter) InsertQuery(tableName string) string

func (DeduplicatorPostgresSchemaAdapter) IsDuplicationError

func (a DeduplicatorPostgresSchemaAdapter) IsDuplicationError(tableName string, dberr error) bool

type DeduplicatorSchemaAdapter

type DeduplicatorSchemaAdapter interface {
	InitializeSchemaQuery(tableName string) string
	InsertQuery(tableName string) string
	IsDuplicationError(tableName string, dberr error) bool
}

type DuplicationError

type DuplicationError struct {
	Err error
}

func (DuplicationError) Error

func (e DuplicationError) Error() string

func (DuplicationError) Unwrap

func (e DuplicationError) Unwrap() error

type Extension

type Extension struct {
	entc.DefaultExtension
}

func (Extension) Hooks

func (e Extension) Hooks() []gen.Hook

func (Extension) Name

func (Extension) Name() string

func (Extension) Options

func (Extension) Options() []entc.Option

func (Extension) Templates

func (Extension) Templates() []*gen.Template

Jump to

Keyboard shortcuts

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