loader

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector interface {
	Library
	Connect() error
	Disconnect() error
}

type DbMap

type DbMap map[string]any

type IDatabase

type IDatabase interface {
	Connector

	// Common methods that both databases should implement
	Ping(ctx context.Context) error

	// Get the underlying connection for specific operations
	GetConnection() any
	GetDriver() string
	GetName() string

	Count(ctx context.Context, table string, filter DbMap) (int64, error)
	Find(ctx context.Context, table string, column []string, filter DbMap, sort map[string]int, limit int64, skip int64) ([]DbMap, error)
	FindOne(ctx context.Context, result any, table string, column []string, filter DbMap, sort map[string]int) error
	InsertOne(ctx context.Context, table string, data any) (any, error)
	Update(ctx context.Context, table string, filter DbMap, data any) (int64, error)
	UpdateOne(ctx context.Context, table string, filter DbMap, data any) (int64, error)
	Delete(ctx context.Context, table string, filter DbMap) (any, error)
	DeleteOne(ctx context.Context, table string, filter DbMap) (any, error)
}

type IKafka

type IKafka interface {
	Connector

	Publish(ctx context.Context, topic string, message any) error
	Consume(ctx context.Context, topic string) (<-chan any, error)
}

type IPubSub

type IPubSub interface {
	Connector

	Publish(ctx context.Context, message any, attributes map[string]string) (string, error)
	RegisterReceiver(receiver PubSubReceiver)
	StartReceiving(ctx context.Context)
}

type IPubSubMessage

type IPubSubMessage interface {
	GetID() string
	GetData() []byte
	GetPublishTime() time.Time
	GetAttributes() map[string]string
}

type IRedis

type IRedis interface {
	Connector

	GetClient() any
}

type KafkaConsumer

type KafkaConsumer interface {
	Consume(ctx context.Context, message []byte) (bool, error)
}

type Library

type Library interface {
	Install(args ...any) error
	Uninstall() error
}

type PubSubReceiver

type PubSubReceiver interface {
	Consume(ctx context.Context, messages []IPubSubMessage) (map[string]bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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