claw

package
v0.0.0-...-f8a11b1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Container = make(map[int32]Config)

Functions

This section is empty.

Types

type Config

type Config struct {
	Id           int32
	Name         string
	SourceTree   *SourceTree
	TargetType   consts.SourceType
	TargetSource string
	TargetSet    string
	Comments     string
	Deleted      bool
	CreatedTime  time.Time
	UpdatedTime  time.Time
}

func FindConfigs

func FindConfigs(datasource string, dataset string) []*Config

func (*Config) Handle

func (cfg *Config) Handle(food plate.Food)

type SourceField

type SourceField struct {
	Column                string                       //源字段
	Target                string                       //目标字段
	SourceFieldTargetType consts.SourceFieldTargetType //源字段->目标字段 的转换类型
}

type SourceFilter

type SourceFilter struct {
	Type            consts.SourceRelationType //字段之间关系(AND/OR)
	Values          map[string][]string       //字段的值,e.g. {"column1": ["value1", "value2"], "column2": ["value3"]}
	ExtraConditions []string                  // 额外条件
	ExtraColumns    []string                  //需要查询的额外列,一般用于分组
}

type SourceRelation

type SourceRelation struct {
	SourceTree         SourceTree    // 子节点
	SourceRelationType string        //多字段之间关系(AND/OR)
	Fields             []SourceField // 与子节点的关联字段
}

type SourceTree

type SourceTree struct {
	SourceType     consts.SourceType //数据来源类型
	DataSource     string            //数据来源
	DataSet        string            //数据集
	Priority       int32             //数据集相同时的优先级
	Subscribed     bool              //是否订阅
	IdColumn       string            //ID列名
	TimeColumn     string            //时间列名
	DeleteColumn   string            //软删除列名
	ExtraCondition string            //额外条件(仅针对MYSQL)
	Fields         []SourceField     //字段映射
	Relations      []SourceRelation  //关联关系
}

func (*SourceTree) Fetch

func (st *SourceTree) Fetch(sf SourceFilter, withRelation bool) map[string][]map[string]string

func (*SourceTree) GetKey

func (st *SourceTree) GetKey() string

func (*SourceTree) SearchNode

func (st *SourceTree) SearchNode(dataSource string, dataSet string, priority int32) *SourceTree

func (*SourceTree) SearchParent

func (st *SourceTree) SearchParent(root *SourceTree) *SourceTree

Jump to

Keyboard shortcuts

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