writer

package
v0.0.0-...-e96982d Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UpdateTemplate = `UPDATE "%s" SET %s WHERE "%s" = :primary_val`
	InsertTemplate = `INSERT INTO "%s" (%s) VALUES (%s)`
	DeleteTemplate = `DELETE FROM "%s" WHERE "%s" = :primary_val`
)

Functions

This section is empty.

Types

type CollectionRecord

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

type DBCommand

type DBCommand struct {
	PipelineID uint64
	Sequence   uint64
	Reference  interface{}
	Record     *gravity_sdk_types_record.Record
	QueryStr   string
	Args       map[string]interface{}
	Tables     []string
}

func (*DBCommand) GetPipelineID

func (cmd *DBCommand) GetPipelineID() uint64

func (*DBCommand) GetReference

func (cmd *DBCommand) GetReference() interface{}

func (*DBCommand) GetSequence

func (cmd *DBCommand) GetSequence() uint64

func (*DBCommand) GetTables

func (cmd *DBCommand) GetTables() []string

type DatabaseInfo

type DatabaseInfo struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Secure   bool   `json:"secure"`
	Username string `json:"username"`
	Password string `json:"password"`
	DbName   string `json:"dbname"`
}

type MongoDBConnector

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

func NewMongoDBConnector

func NewMongoDBConnector() *MongoDBConnector

func (*MongoDBConnector) Connect

func (mdb *MongoDBConnector) Connect() error

func (*MongoDBConnector) GetClient

func (mdb *MongoDBConnector) GetClient() *mongo.Client

func (*MongoDBConnector) InitializeDatabase

func (mdb *MongoDBConnector) InitializeDatabase() error

func (*MongoDBConnector) LoadCert

func (mdb *MongoDBConnector) LoadCert(caFile string) (*tls.Config, error)

type Writer

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

func NewWriter

func NewWriter() *Writer

func (*Writer) DeleteRecord

func (writer *Writer) DeleteRecord(reference interface{}, record *gravity_sdk_types_record.Record, tables []string) error

func (*Writer) Init

func (writer *Writer) Init() error

func (*Writer) InsertRecord

func (writer *Writer) InsertRecord(reference interface{}, record *gravity_sdk_types_record.Record, tables []string) error

func (*Writer) ProcessData

func (writer *Writer) ProcessData(reference interface{}, record *gravity_sdk_types_record.Record, tables []string) error

func (*Writer) SetCompletionHandler

func (writer *Writer) SetCompletionHandler(fn database.CompletionHandler)

func (*Writer) Truncate

func (writer *Writer) Truncate(table string) error

func (*Writer) UpdateRecord

func (writer *Writer) UpdateRecord(reference interface{}, record *gravity_sdk_types_record.Record, tables []string) error

Jump to

Keyboard shortcuts

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