dbr_sync

package module
v0.0.0-...-220ef87 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 16 Imported by: 0

README

dbr-sync

Build Status | codecov | Go Report Card | GoDoc

A service to sync data between databases.

If i miss something or you have something interesting, please be part of this project. Let me know! My contact is at the end.

Dependecy Management

Dependency

Project dependencies are managed using Dep. Read more about Dep.

  • Get dependency manager: go get github.com/joaosoft/dependency
  • Install dependencies: dependency get
Go
go get github.com/joaosoft/dbr-sync

Known issues

Follow me at

Facebook: https://www.facebook.com/joaosoft

LinkedIn: https://www.linkedin.com/in/jo%C3%A3o-ribeiro-b2775438/

If you have something to add, please let me know joaosoft@gmail.com

Documentation

Index

Constants

View Source
const (
	ModeDetails mode = "details"
	ModeQuery   mode = "query"
)

Variables

View Source
var (
	ErrorNotFound    = errors.New(errors.LevelError, int(web.StatusNotFound), "user not found")
	ErrorInvalidType = errors.New(errors.LevelError, int(web.StatusNotFound), "invalid type")
)

Functions

func EncodeString

func EncodeString(s string) string

func Exists

func Exists(file string) bool

func GetEnv

func GetEnv() string

func ReadFile

func ReadFile(file string, obj interface{}) ([]byte, error)

func ReadFileLines

func ReadFileLines(file string) ([]string, error)

func WriteFile

func WriteFile(file string, obj interface{}) error

Types

type AppConfig

type AppConfig struct {
	DbrSync *DbrSyncConfig `json:"dbr-sync"`
}

AppConfig ...

func NewConfig

func NewConfig() (*AppConfig, manager.IConfig, error)

NewConfig ...

type DbrSync

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

func NewDbrSync

func NewDbrSync(options ...DbrSyncOption) (*DbrSync, error)

NewDbrSync ...

func (*DbrSync) Reconfigure

func (dbrSync *DbrSync) Reconfigure(options ...DbrSyncOption)

Reconfigure ...

func (*DbrSync) Start

func (m *DbrSync) Start() error

Start ...

func (*DbrSync) Stop

func (m *DbrSync) Stop() error

Stop ...

type DbrSyncConfig

type DbrSyncConfig struct {
	Rabbitmq  RabbitmqConfig             `json:"rabbitmq"`
	Dbr       *dbr.DbrConfig             `json:"dbr"`
	Migration *migration.MigrationConfig `json:"migration"`
	Mode      mode                       `json:"mode"`
	Log       struct {
		Level string `json:"level"`
	} `json:"log"`
}

ProfileConfig ...

type DbrSyncOption

type DbrSyncOption func(dbrSync *DbrSync)

DbrSyncOption ...

func WithConfiguration

func WithConfiguration(config *DbrSyncConfig) DbrSyncOption

WithConfiguration ...

func WithLogLevel

func WithLogLevel(level logger.Level) DbrSyncOption

WithLogLevel ...

func WithLogger

func WithLogger(logger logger.ILogger) DbrSyncOption

WithLogger ...

func WithManager

func WithManager(mgr *manager.Manager) DbrSyncOption

WithManager ...

type Details

type Details struct {
	Table      string                 `json:"table"`
	Values     map[string]interface{} `json:"values"`
	Conditions map[string]interface{} `json:"conditions"`
}

type Operation

type Operation struct {
	Operation dbr.SqlOperation `json:"operation"`
	Query     *string          `json:"query"`
	Details   *Details         `json:"details"`
}

type OperationList

type OperationList []*Operation

type RabbitmqConfig

type RabbitmqConfig struct {
	*manager.RabbitmqConfig
	Queue   string `json:"queue"`
	Binding string `json:"binding"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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