mongo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCursorNotFound = errors.New("cursor not found")

Functions

This section is empty.

Types

type DatabaseType

type DatabaseType string
const (
	INTEGER   DatabaseType = "integer"
	DOUBLE    DatabaseType = "double"
	BOOLEAN   DatabaseType = "boolean"
	TIMESTAMP DatabaseType = "timestamp"
	NULL      DatabaseType = "null"
	DATE      DatabaseType = "date"
)

type Fields

type Fields map[string]DatabaseType

type Loader

type Loader struct {
	Collections Tables
	// contains filtered or unexported fields
}

func NewMongoDB

func NewMongoDB(address string, databaseName string, logger *zap.Logger) (*Loader, error)

func (*Loader) Delete

func (l *Loader) Delete(ctx context.Context, collectionName string, id string) error

func (*Loader) GetCursor

func (l *Loader) GetCursor(ctx context.Context, outputModuleHash string) (*sink.Cursor, error)

func (*Loader) Ping

func (l *Loader) Ping(ctx context.Context) error

func (*Loader) Save

func (l *Loader) Save(ctx context.Context, collectionName string, id string, entity map[string]interface{}) error

func (*Loader) Update

func (l *Loader) Update(ctx context.Context, collectionName string, id string, changes map[string]interface{}) error

func (*Loader) WriteCursor

func (l *Loader) WriteCursor(ctx context.Context, moduleHash string, c *sink.Cursor) error

type Tables

type Tables map[string]Fields

Jump to

Keyboard shortcuts

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