ddsspfile

package module
v0.0.0-...-b090632 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 14 Imported by: 11

README

dds-spfile

Documentation

Index

Constants

View Source
const (
	IpV4Reg  = "^((0|[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(0|[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-5])$"
	IpV4Port = "^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"
)
View Source
const (
	AnnotationPrefix = "--"
)

Variables

View Source
var ProcessBus processSet

Functions

func GetExtractName

func GetExtractName() string

func GetMySQLName

func GetMySQLName() string

func GetOracleName

func GetOracleName() string

func GetReplicationName

func GetReplicationName() string

func MatchSchemaTable

func MatchSchemaTable(owner, table, val *string, log *logrus.Logger) bool

func ValToUper

func ValToUper(v string) string

Types

type ClientCharacterSet

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

type ClientCollation

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

type DBOptions

type DBOptions struct {
	OptionsSet *Options
	// contains filtered or unexported fields
}

type DBOptionsJson

type DBOptionsJson struct {
	Type *string     `json:"PARAMS_TYPE"`
	Opts []*OptsList `json:"OPTIONS"`
}

type DBOptionsSet

type DBOptionsSet struct {
	// contains filtered or unexported fields
}
var DBOptionsBus DBOptionsSet

func (*DBOptionsSet) Add

func (d *DBOptionsSet) Add(raw *string) error

func (*DBOptionsSet) GetParam

func (d *DBOptionsSet) GetParam() interface{}

func (*DBOptionsSet) Init

func (d *DBOptionsSet) Init()

func (*DBOptionsSet) ListParamText

func (d *DBOptionsSet) ListParamText() string

func (*DBOptionsSet) MarshalJson

func (d *DBOptionsSet) MarshalJson() ([]byte, error)

func (*DBOptionsSet) Registry

func (d *DBOptionsSet) Registry() map[string]Parameter

type DdlJson

type DdlJson struct {
	Type    *string  `json:"PARAMS_TYPE"`
	Range   *string  `json:"TYPE"`
	Owner   *string  `json:"OWNER"`
	Table   *string  `json:"TABLE"`
	OpType  []string `json:"OPTYPE"`
	ObjType []string `json:"OBJTYPE"`
}

序列化DDL

type DdlList

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

func (*DdlList) Filter

func (d *DdlList) Filter(owner, table, optype, objtype string) bool

type DdlSmt

type DdlSmt struct {
	ParamPrefix *string  // 参数前缀
	DdlBus      *DdlList // DDL列表
	// contains filtered or unexported fields
}

type DdlSmtSet

type DdlSmtSet struct {
	// contains filtered or unexported fields
}
var DdlSmtSetBus DdlSmtSet

func (*DdlSmtSet) Add

func (d *DdlSmtSet) Add(raw *string) error

func (*DdlSmtSet) GetParam

func (d *DdlSmtSet) GetParam() interface{}

func (*DdlSmtSet) Init

func (d *DdlSmtSet) Init()

func (*DdlSmtSet) ListParamText

func (d *DdlSmtSet) ListParamText() string

func (*DdlSmtSet) MarshalJson

func (d *DdlSmtSet) MarshalJson() ([]byte, error)

func (*DdlSmtSet) Registry

func (d *DdlSmtSet) Registry() map[string]Parameter

type DiscardFile

type DiscardFile struct {
	Dir *string
	// contains filtered or unexported fields
}

type DiscardFileSet

type DiscardFileSet struct {
	// contains filtered or unexported fields
}
var DiscardFileBus DiscardFileSet

func (*DiscardFileSet) Add

func (d *DiscardFileSet) Add(raw *string) error

func (*DiscardFileSet) GetParam

func (d *DiscardFileSet) GetParam() interface{}

func (*DiscardFileSet) Init

func (d *DiscardFileSet) Init()

func (*DiscardFileSet) ListParamText

func (d *DiscardFileSet) ListParamText() string

func (*DiscardFileSet) MarshalJson

func (d *DiscardFileSet) MarshalJson() ([]byte, error)

func (*DiscardFileSet) Registry

func (d *DiscardFileSet) Registry() map[string]Parameter

type DiscardJson

type DiscardJson struct {
	Type *string `json:"PARAMS_TYPE"`
	Dir  *string `json:"DIR"`
}

type ETL

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

type Encoding

type Encoding uint
const (
	UTF8 Encoding
	ISO88591
)

type ExcludeTableSet

type ExcludeTableSet struct {
	// contains filtered or unexported fields
}
var ExcludeTableSetBus ExcludeTableSet

func (*ExcludeTableSet) Add

func (e *ExcludeTableSet) Add(raw *string) error

func (*ExcludeTableSet) GetParam

func (e *ExcludeTableSet) GetParam() interface{}

func (*ExcludeTableSet) Init

func (e *ExcludeTableSet) Init()

func (*ExcludeTableSet) ListParamText

func (e *ExcludeTableSet) ListParamText() string

func (*ExcludeTableSet) MarshalJson

func (e *ExcludeTableSet) MarshalJson() ([]byte, error)

func (*ExcludeTableSet) Registry

func (e *ExcludeTableSet) Registry() map[string]Parameter

type ExcludeTableSets

type ExcludeTableSets struct {
	TableBus *TableExcludeList
	// contains filtered or unexported fields
}

type Module

type Module interface {
	Init()
	Add(raw *string) error
	ListParamText() string
	MarshalJson() ([]byte, error)
	GetParam() interface{}
}

type ObjectNode

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

type OdbInfo

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

func (*OdbInfo) GetClientCharacter

func (u *OdbInfo) GetClientCharacter() string

func (*OdbInfo) GetConnInfo

func (u *OdbInfo) GetConnInfo() *OdbInfo

func (*OdbInfo) GetHostAddress

func (u *OdbInfo) GetHostAddress() []string

func (*OdbInfo) GetPassWord

func (u *OdbInfo) GetPassWord() string

func (*OdbInfo) GetPort

func (u *OdbInfo) GetPort() uint16

func (*OdbInfo) GetRetryMaxConnNumber

func (u *OdbInfo) GetRetryMaxConnNumber() int

func (*OdbInfo) GetSID

func (u *OdbInfo) GetSID() string

func (*OdbInfo) GetTimeZone

func (u *OdbInfo) GetTimeZone() string

func (*OdbInfo) GetUserName

func (u *OdbInfo) GetUserName() string

type Options

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

func (*Options) GetIgnoreForeignkey

func (o *Options) GetIgnoreForeignkey() (*bool, error)

func (*Options) GetReplicates

func (o *Options) GetReplicates() (*bool, error)

func (*Options) GetSuppressionTrigger

func (o *Options) GetSuppressionTrigger() (*bool, error)

type OptsList

type OptsList struct {
	Key   string `json:"KEY"`
	Value bool   `json:"VALUE"`
}

type Parameter

type Parameter interface {
	// contains filtered or unexported methods
}

type Parameters

type Parameters interface {
	Module
	Registry() map[string]Parameter
}

type PassWordModel

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

type PortModel

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

type Process

type Process struct {
	ProInfo *ProcessInfo
	// contains filtered or unexported fields
}

type ProcessInfo

type ProcessInfo struct {
	Name *string
}

func (*ProcessInfo) GetName

func (p *ProcessInfo) GetName() *string

type ProcessJson

type ProcessJson struct {
	Type *string `json:"PARAMS_TYPE"`
	Name *string `json:"NAME"`
}

序列化进程名称

type RetryMaxConnect

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

type ServerIdModel

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

type SourceDB

type SourceDB struct {
	DBInfo *dbInfo
	// contains filtered or unexported fields
}

type SourceDBJson

type SourceDBJson struct {
	Type               *string `json:"PARAMS_TYPE"`
	Address            *string `json:"ADDRESS"`            // 数据库地址
	Port               *uint16 `json:"PORT"`               // 数据库端口
	Types              *string `json:"DATABASETYPE"`       // 连接数据库类型, mysql或 mariadb
	UserId             *string `json:"USERID"`             // 用户名
	PassWord           *string `json:"PASSWORD"`           // 密码
	ServerId           *uint32 `json:"SERVERID"`           // mysql server id
	RetryMaxConnNumber *int    `json:"RETRYMAXCONNNUMBER"` // 连接重连最大次数
	ClientCharacter    *string `json:"CLIENTCHARACTER"`    // 客户端字符集
	ClientCollation    *string `json:"CLIENTCOLLATION"`    // 客户端字符集
}

type Spfile

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

func LoadSpfile

func LoadSpfile(file string, enc Encoding, log *logrus.Logger, dbType string, processType string) (*Spfile, error)

func (*Spfile) DDLFilter

func (s *Spfile) DDLFilter(owner, table, optype, objtype string) bool

DDL过滤

func (*Spfile) DMLExcludeFilter

func (s *Spfile) DMLExcludeFilter(owner, table *string) (bool, error)

DML MAP Exclude 过滤

func (*Spfile) DMLFilter

func (s *Spfile) DMLFilter(owner, table *string) (bool, error)

func (*Spfile) DMLInlucdeFilter

func (s *Spfile) DMLInlucdeFilter(owner, table *string) (bool, error)

DML MAP INCLUDE 过滤

func (*Spfile) GetMySQLDBConnStr

func (s *Spfile) GetMySQLDBConnStr() *dbInfo

获取Mysql连接串

func (*Spfile) GetOracleDBConnStr

func (s *Spfile) GetOracleDBConnStr() *OdbInfo

获取Oracle连接串

func (*Spfile) GetProcessName

func (s *Spfile) GetProcessName() *string

获取进程名称

func (*Spfile) GetTrail

func (s *Spfile) GetTrail() *TrailAttribute

获取trail info

func (*Spfile) LoadToDatabase

func (s *Spfile) LoadToDatabase() error

func (*Spfile) Production

func (s *Spfile) Production() error

生产参数,必须调用

func (*Spfile) PutParamsText

func (s *Spfile) PutParamsText()

输出所有参数

type TableExcludeJson

type TableExcludeJson struct {
	Type  *string `json:"PARAMS_TYPE"`
	Owner string  `json:"OWNER"`
	Table string  `json:"TABLE"`
}

type TableExcludeList

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

func (*TableExcludeList) Filter

func (d *TableExcludeList) Filter(owner, table *string, log *logrus.Logger) (bool, error)

type TableJson

type TableJson struct {
	Type  *string `json:"PARAMS_TYPE"`
	Owner string  `json:"OWNER"`
	Table string  `json:"TABLE"`
}

序列化进程名称

type TableList

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

func (*TableList) Filter

func (d *TableList) Filter(owner, table *string, log *logrus.Logger) (bool, error)

type TableSet

type TableSet struct {
	// contains filtered or unexported fields
}
var TableSetBus TableSet

func (*TableSet) Add

func (t *TableSet) Add(raw *string) error

func (*TableSet) GetParam

func (t *TableSet) GetParam() interface{}

func (*TableSet) Init

func (t *TableSet) Init()

func (*TableSet) ListParamText

func (t *TableSet) ListParamText() string

func (*TableSet) MarshalJson

func (t *TableSet) MarshalJson() ([]byte, error)

func (*TableSet) Registry

func (t *TableSet) Registry() map[string]Parameter

type TableSets

type TableSets struct {
	TableBus *TableList
	// contains filtered or unexported fields
}

type TimeZone

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

type TrailAttribute

type TrailAttribute struct {
	SizeValue *int
	SizeUnit  *string
	// contains filtered or unexported fields
}

func (*TrailAttribute) GetDir

func (t *TrailAttribute) GetDir() *string

func (*TrailAttribute) GetKeepKey

func (t *TrailAttribute) GetKeepKey() *string

func (*TrailAttribute) GetKeepUnit

func (t *TrailAttribute) GetKeepUnit() *string

func (*TrailAttribute) GetKeepVal

func (t *TrailAttribute) GetKeepVal() *int

func (*TrailAttribute) GetSizeKey

func (t *TrailAttribute) GetSizeKey() *string

func (*TrailAttribute) GetSizeUnit

func (t *TrailAttribute) GetSizeUnit() *string

func (*TrailAttribute) GetSizeValue

func (t *TrailAttribute) GetSizeValue() *int

func (*TrailAttribute) GetTrail

func (t *TrailAttribute) GetTrail() *TrailAttribute

type TrailDir

type TrailDir struct {
	DirTrailAttribute *TrailAttribute
	// contains filtered or unexported fields
}

type TrailDirJson

type TrailDirJson struct {
	Type     *string `json:"PARAMS_TYPE"`
	Dir      *string `json:"DIR"`
	Size     *int    `json:"SIZE"`
	SizeUnit *string `json:"SIZEUNIT"`
	Keep     *int    `json:"KEEP"`
	KeepUnit *string `json:"KEEPUNIT"`
}

type TypeModel

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

type UserIDJson

type UserIDJson struct {
	Type               *string  `json:"PARAMS_TYPE"`
	Address            []string `json:"ADDRESS"`            // 数据库地址
	Port               *uint16  `json:"PORT"`               // 数据库端口
	UserName           *string  `json:"USERNAME"`           // 用户名
	Sid                *string  `json:"SID"`                // instance id
	PassWord           *string  `json:"PASSWORD"`           // 密码
	RetryMaxConnNumber *int     `json:"RETRYMAXCONNNUMBER"` // 连接重连最大次数
	ClientCharacter    *string  `json:"CLIENTCHARACTER"`    // 客户端字符集
	TimeZone           *string  `json:"TIMEZONE"`           // 时区
}

type UserId

type UserId struct {
	ParamPrefix *string  `json:"PARAMS_TYPE"` // 参数前缀
	DBInfo      *OdbInfo `json:"DBINFO"`
	// contains filtered or unexported fields
}

type UserIdClientCharacterSet

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

type UserIdIpSet

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

func (*UserIdIpSet) SetIpAddress

func (u *UserIdIpSet) SetIpAddress(ip *string) error

type UserIdModel

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

type UserIdPassWordModel

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

type UserIdPortModel

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

type UserIdRetryMaxConnect

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

type UserIdServerIdModel

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

type UserIdSidModel

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

type UserIdTimeZone

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

type UserIdUserIdModel

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

func (*UserIdUserIdModel) SetUserId

func (u *UserIdUserIdModel) SetUserId(uid *string)

Jump to

Keyboard shortcuts

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