aliyun

package
v1.0.37 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MYSQL_TYPE_DECIMAL = iota
	MYSQL_TYPE_INT8
	MYSQL_TYPE_INT16
	MYSQL_TYPE_INT32
	MYSQL_TYPE_FLOAT
	MYSQL_TYPE_DOUBLE
	MYSQL_TYPE_NULL
	MYSQL_TYPE_TIMESTAMP
	MYSQL_TYPE_INT64
	MYSQL_TYPE_INT24
	MYSQL_TYPE_DATE
	MYSQL_TYPE_TIME
	MYSQL_TYPE_DATETIME
	MYSQL_TYPE_YEAR
	MYSQL_TYPE_DATE_NEW
	MYSQL_TYPE_VARCHAR
	MYSQL_TYPE_BIT
	MYSQL_TYPE_TIMESTAMP_NEW
)
View Source
const ALIYUN_DTS_SCHEMA = `` /* 10904-byte string literal not displayed */
View Source
const DefaultExpireTime = 600

Variables

This section is empty.

Functions

This section is empty.

Types

type AliDts

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

func New

func New() (*AliDts, error)

func (*AliDts) Parse

func (ad *AliDts) Parse(data []byte) (*DtsRecord, error)

Parse 解析DTS的消息记录

type AliOss

type AliOss struct {
	AccessKey    string
	AccessSecret string
	Domain       string
	Endpoint     string
}

func NewAliOss

func NewAliOss(domain, endpoint, accessKey, accessSecret string) *AliOss

func (*AliOss) GenSignature

func (a *AliOss) GenSignature(dir string) (*OssSignature, error)

GenSignature 生成oss直传token

func (*AliOss) Upload

func (a *AliOss) Upload(bucket, dir, fileName string, data []byte) (string, error)

Upload file

type DtsField

type DtsField struct {
	Name     string `mapstructure:"name"`
	DataType int    `mapstructure:"dataTypeNumber"`
}

type DtsFields

type DtsFields struct {
	Items []*DtsField `mapstructure:"array"`
}

type DtsRecord

type DtsRecord struct {
	Version         int                    `mapstructure:"version"`
	Id              int64                  `mapstructure:"id"`
	SourceTimeStamp int64                  `mapstructure:"sourceTimestamp"`
	SourceTxId      string                 `mapstructure:"sourceTxid"`
	ObjectName      map[string]string      `mapstructure:"objectName"` // 数据库名.表名
	Operation       string                 `mapstructure:"operation"`
	Fields          map[string]interface{} `mapstructure:"fields"`       // 字段slice
	BeforeImages    map[string]interface{} `mapstructure:"beforeImages"` // 改变前
	AfterImages     map[string]interface{} `mapstructure:"afterImages"`  // 改变后

	// 额外的字段
	Database    string
	Table       string
	TableFields []*DtsField
}

DtsRecord 原始的记录

func (*DtsRecord) GetAfterColumns

func (r *DtsRecord) GetAfterColumns() map[string]string

func (*DtsRecord) GetBeforeColumns

func (r *DtsRecord) GetBeforeColumns() map[string]string

type DtsTypeBytes

type DtsTypeBytes struct {
	Value []byte `mapstructure:"value"`
}

type DtsTypeDateTime

type DtsTypeDateTime struct {
	Year   map[string]interface{} `mapstructure:"year"`
	Month  map[string]interface{} `mapstructure:"month"`
	Day    map[string]interface{} `mapstructure:"day"`
	Hour   map[string]interface{} `mapstructure:"hour"`
	Minute map[string]interface{} `mapstructure:"minute"`
	Second map[string]interface{} `mapstructure:"second"`
}

type DtsTypeTimestamp

type DtsTypeTimestamp struct {
	Timestamp int64 `mapstructure:"timestamp"`
}

type DtsTypeTimestampWithTimeZone

type DtsTypeTimestampWithTimeZone struct {
	Value DtsTypeDateTime `mapstructure:"value"`
}

type DtsTypeValue

type DtsTypeValue struct {
	Value string `mapstructure:"value"`
}

type OssPolicyConfig

type OssPolicyConfig struct {
	Expiration string     `json:"expiration"`
	Conditions [][]string `json:"conditions"`
}

type OssSignature

type OssSignature struct {
	AccessKeyId string
	Host        string
	Expire      int64
	Signature   string
	Directory   string
	Policy      string
}

Jump to

Keyboard shortcuts

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