driver

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const API_VERSION = "v1.0"
View Source
const RegularxEpression = `\{\$([a-zA-Z0-9\-\_]+)\}`

Variables

This section is empty.

Functions

func CheckUri

func CheckUri(name string, uri string) error

func Drivers

func Drivers() map[string]DriverStructure

func GetApiVersion

func GetApiVersion() string

func Register

func Register(name string, driver Driver, version string, bifrost_version string)

func TransfeResult

func TransfeResult(val string, data *PluginDataType, rowIndex int) string

Types

type ConnFun

type ConnFun interface {
	GetConnStatus() string
	SetConnStatus(status string)
	Connect() bool
	ReConnect() bool
	HeartCheck()
	Close() bool
	Insert(data *PluginDataType) (*PluginBinlog, error) //状态,是否立马更新binlog,错误内容
	Update(data *PluginDataType) (*PluginBinlog, error)
	Del(data *PluginDataType) (*PluginBinlog, error)
	Query(data *PluginDataType) (*PluginBinlog, error)
	SetParam(p interface{}) (interface{}, error)
	Commit() (*PluginBinlog, error)
}

func Open

func Open(name string, uri string) ConnFun

type Driver

type Driver interface {
	Open(uri string) ConnFun
	GetUriExample() string
	CheckUri(uri string) error
}

type DriverStructure

type DriverStructure struct {
	Version        string // 插件版本
	BifrostVersion string // 插件开发所使用的Bifrost的版本
	Error          string
	ExampleConnUri string
	// contains filtered or unexported fields
}

type PluginBinlog

type PluginBinlog struct {
	BinlogFileNum  int
	BinlogPosition uint32
}

type PluginDataType

type PluginDataType struct {
	Timestamp      uint32
	EventType      string
	Rows           []map[string]interface{}
	Query          string
	SchemaName     string
	TableName      string
	BinlogFileNum  int
	BinlogPosition uint32
	Pri            []*string
}

type ToPluginParam

type ToPluginParam struct {
	FromPluginBinlogChan chan PluginBinlog
}

Jump to

Keyboard shortcuts

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