util

package
v0.0.0-...-cba6ad5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetV1ResultBadRequest

func GetV1ResultBadRequest(msg string) *v1.Result

func GetV1ResultInternalError

func GetV1ResultInternalError(msg string) *v1.Result

func GetV1ResultOK

func GetV1ResultOK() *v1.Result

func SortStringSlice

func SortStringSlice(s []string) []string

sort slice.

Types

type ConnectInfo

type ConnectInfo struct {
	User string `json:"user" mapstructure:"user"`

	Database  string   `json:"database" mapstructure:"database"`
	Endpoints []string `json:"endpoints" mapstructure:"endpoints"`
	SinkType  string   `json:"sink_type"`
	// contains filtered or unexported fields
}

func (*ConnectInfo) GetPassword

func (this *ConnectInfo) GetPassword() string

func (*ConnectInfo) Key

func (this *ConnectInfo) Key() string

func (*ConnectInfo) SetPassword

func (this *ConnectInfo) SetPassword(pass string)

func (*ConnectInfo) Value

func (this *ConnectInfo) Value() []byte

type MapField

type MapField struct {
	TField ModelField `json:"tfield" mapstructure:"tfield"`
	MField ModelField `json:"mfield" mapstructure:"mfield"`
}

type MappingInfo

type MappingInfo struct {
	ConnInfo  ConnectInfo `json:"conn" mapstructure:"conn"`
	TableName string      `json:"table" mapstructure:"table"`
	Maps      []MapField  `json:"maps" mapstructure:"maps"`
}

func MergeMapping

func MergeMapping(m1, m2 *MappingInfo) *MappingInfo

func NewConnectInfoFromJson

func NewConnectInfoFromJson(v interface{}) *MappingInfo

func (*MappingInfo) GetConnInfo

func (this *MappingInfo) GetConnInfo() ConnectInfo

func (*MappingInfo) GetDatabase

func (this *MappingInfo) GetDatabase() string

func (*MappingInfo) GetEndpoints

func (this *MappingInfo) GetEndpoints() []string

func (*MappingInfo) GetPassword

func (this *MappingInfo) GetPassword() string

func (*MappingInfo) GetUser

func (this *MappingInfo) GetUser() string

func (*MappingInfo) SetConnInfo

func (this *MappingInfo) SetConnInfo(conn ConnectInfo)

type ModelField

type ModelField struct {
	Name string `json:"name" mapstructure:"name"`
	Type string `json:"type" mapstructure:"type"`
}

type MyStringList

type MyStringList []string

将[]string定义为MyStringList类型

func (MyStringList) Len

func (m MyStringList) Len() int

实现sort.Interface接口的获取元素数量方法

func (MyStringList) Less

func (m MyStringList) Less(i, j int) bool

实现sort.Interface接口的比较元素方法

func (MyStringList) Swap

func (m MyStringList) Swap(i, j int)

实现sort.Interface接口的交换元素方法

Jump to

Keyboard shortcuts

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