models

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

*

  • 集群数据结构

*

  • 库数据结构

*

  • 用户数据结构

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type And added in v0.7.2

type And struct {
	Field  *Field_ `json:"field"`
	Relate string  `json:"relate"`
}

type ClusterInfo

type ClusterInfo struct {
	Id             int    `json:"id"`
	Name           string `json:"name"`
	MasterUrl      string `json:"master_url"`
	GatewayHttpUrl string `json:"gateway_http"`
	GatewaySqlUrl  string `json:"gateway_sql"`
	ClusterToken   string `json:"cluster_sign"`
	CreateTime     int64  `json:"create_time"`

	//true 表示禁止自动分片
	AutoSplitUnable bool `json:"auto_split"`
	//true 表示禁止自动迁移
	AutoTransferUnable bool `json:"auto_transfer"`
	// true 表示禁止自动failover
	AutoFailoverUnable bool `json:"auto_failover"`
}

func BuildClusterInfo

func BuildClusterInfo(clusterId int, clusterName string, masterUrl string, gatewayHttpUrl string,
	gatewaySqlUrl string, createSign string, createTime int64) *ClusterInfo

func NewClusterInfo

func NewClusterInfo() *ClusterInfo

type Column

type Column struct {
	// max size 128 bytes
	Name string `json:"name,omitempty"`
	// 列名映射的ID
	Id       uint64 `json:"id,omitempty"`
	DataType int    `json:"data_type,omitempty"`
	// 针对int类型,是否是无符号类型
	Unsigned bool `son:"unsigned,omitempty"`
	// 针对float和varchar类型
	Scale int32 `json:"scale,omitempty"`
	// 针对float类型
	Precision int32 `json:"precision,omitempty"`
	// 是否可以为空
	Nullable bool `json:"nullable,omitempty"`
	// 是否主键
	PrimaryKey uint64 `json:"primary_key,omitempty"`
	// 列的顺序
	Ordinal int32 `json:"ordinal,omitempty"`
	// 索引 Binary不支持索引,其他类型列默认均是索引列
	Index        bool   `json:"index,omitempty"`
	DefaultValue []byte `json:"default_value,omitempty"`
	Properties   string `json:"properties,omitempty"`
}

type ColumnInfo

type ColumnInfo struct {
	Id         int    `json:"id"`
	ColumnName string `json:"name"`
	DataType   int    `json:"data_type"`
	Unsigned   bool   `json:"unsigned"`
	PrimaryKey int    `json:"primary_key"`
	Index      bool   `json:"index"`
}

type Command added in v0.7.2

type Command struct {
	Type   string   `json:"type"`
	Field  []string `json:"field"`
	Filter *Filter_ `json:"filter"`
}

type ConfigureInfo added in v0.7.2

type ConfigureInfo struct {
	K          string `json:"k"`
	V          string `json:"v"`
	Version    string `json:"version"`
	Extend     string `json:"extend"`
	CreateTime int64  `json:"create_time"`
	UpdTime    int64  `json:"upd_time"`
	DeleteFlag int8   `json:"delete_flag"`
	Creator    string `json:"creator"`
}

type DbInfo

type DbInfo struct {
	Id         int    `json:"id"`
	Name       string `json:"name"`
	Properties string `json:"properties"`
	CreateTime int64  `json:"create_time"`
}

type DsNode

type DsNode struct {
	Id uint64 `json:"id,omitempty"`
	// rpc 服务地址
	ServerAddr string `json:"server_addr,omitempty"`
	// raft 服务地址
	RaftAddr string `json:"raft_addr,omitempty"`
	// http 管理地址
	HttpAddr string `json:"http_addr,omitempty"`
	State    int32  `json:"state,omitempty"`
	Version  string `json:"version,omitempty"`
}

type Epoch

type Epoch struct {
	ConfVer int `json:"conf_ver"`
	Ver     int `json:"version"`
}

type Field_ added in v0.7.2

type Field_ struct {
	Column string      `json:"column"`
	Value  interface{} `json:"value"`
}

type Filter_ added in v0.7.2

type Filter_ struct {
	And   []*And   `json:"and"`
	Scope *Scope   `json:"scope"`
	Limit *Limit_  `json:"limit"`
	Order []*Order `json:"order"`
}

type Limit_ added in v0.7.2

type Limit_ struct {
	Offset   uint64 `json:"offset"`
	RowCount uint64 `json:"rowcount"`
}

type LockInfo added in v0.7.2

type LockInfo struct {
	K           string `json:"k"`
	V           string `json:"v"`
	LockId      string `json:"lock_id"`
	ExpiredTime int64  `json:"expired_time"`
	UpdTime     int64  `json:"upd_time"`
	DeleteFlag  int8   `json:"delete_flag"`
	Creator     string `json:"creator"`
}

type Member

type Member struct {
	LeaderId uint64    `json:"leader_id,omitempty"`
	Node     []*MsNode `json:"node,omitempty"`
}

type MetricConfig added in v0.6.3

type MetricConfig struct {
	Interval util.Duration `json:"interval"`
	Address  string        `json:"address"`
}

type MetricServer added in v0.6.3

type MetricServer struct {
	Addr string `json:"addr"`
}

type MsNode

type MsNode struct {
	Id                uint64 `json:"id"`
	WebManageAddr     string `json:"web_addr"`
	RpcServerAddr     string `json:"rpc_addr"`
	RaftHeartbeatAddr string `json:"raft_hb_addr"`
	RaftReplicateAddr string `json:"raft_rp_addr"`
}

type NamespaceApply

type NamespaceApply struct {
	Id         string `json:"id"`
	DbName     string `json:"db_name"`
	TableName  string `json:"table_name"`
	ClusterId  int    `json:"cluster_id"`
	DbId       int    `json:"db_id"`
	TableId    int    `json:"table_id"`
	Status     int8   `json:"status"`
	Applyer    string `json:"applyer"`
	Auditor    string `json:"auditor"`
	CreateTime int64  `json:"create_time"`
}

type Order added in v0.7.2

type Order struct {
	By   string `json:"by"`
	Desc bool   `json:"desc"`
}

type PagerInfo added in v0.7.2

type PagerInfo struct {
	PageIndex int
	PageSize  int
	SortName  string
	SortOrder string // asc、desc
}

func (*PagerInfo) GetPageOffset added in v0.7.2

func (p *PagerInfo) GetPageOffset() int

func (*PagerInfo) GetPageSize added in v0.7.2

func (p *PagerInfo) GetPageSize() int

type Peer

type Peer struct {
	Id   uint64  `json:"id,omitempty"`
	Node *DsNode `json:"node,omitempty"`
}

type PeerBrief

type PeerBrief struct {
	Id          uint64 `json:"id,omitempty"`
	Index       uint64 `json:"index,omitempty"`
	Term        uint64 `json:"term,omitempty"`
	Commit      uint64 `json:"commit,omitempty"`
	StartKey    string `json:"start_key,omitempty"`
	EndKey      string `json:"end_key,omitempty"`
	NodeId      uint64 `json:"node_id,omitempty"`
	NodeAddress string `json:"node_address,omitempty"`
	// contains filtered or unexported fields
}

type Query added in v0.7.2

type Query struct {
	Sign         string   `json:"sign"`
	DatabaseName string   `json:"databasename"`
	TableName    string   `json:"tablename"`
	Command      *Command `json:"command"`
}

type Range

type Range struct {
	Id uint64 `json:"id,omitempty"`
	// Range key range [start_key, end_key).
	StartKey   []byte             `json:"start_key,omitempty"`
	EndKey     []byte             `json:"end_key,omitempty"`
	RangeEpoch *metapb.RangeEpoch `json:"range_epoch,omitempty"`
	Peers      []*Peer            `json:"peers,omitempty"`
	// Range state
	State      int32  `json:"state,omitempty"`
	DbName     string `json:"db_name,omitempty"`
	TableName  string `json:"table_name,omitempty"`
	TableId    uint64 `json:"table_id,omitempty"`
	CreateTime int64  `json:"create_time,omitempty"`
	LastHbTime string `json:"last_hb_time,omitempty"`
}

type RangeBrief

type RangeBrief struct {
	Id         uint64   `json:"id,omitempty"`
	StartKey   string   `json:"start_key,omitempty"`
	EndKey     string   `json:"end_key,omitempty"`
	State      int32    `json:"state,omitempty"`
	LastHbTime string   `json:"last_hb_time,omitempty"`
	DownPeers  []uint64 `json:"down_peers,omitempty"`
	Peers      []uint64 `json:"peers,omitempty"`
	Leader     uint64   `json:"leader,omitempty"`
}

type Reply added in v0.7.2

type Reply struct {
	Code         int             `json:"code"`
	RowsAffected uint64          `json:"rowsaffected"`
	Values       [][]interface{} `json:"values"`
	Message      string          `json:"message"`
}

type Role

type Role struct {
	Id       uint64 `json:"role_id"`
	RoleName string `json:"role_name"`
}

func NewRole

func NewRole() *Role

type Route

type Route struct {
	Range  *Range `json:"range,omitempty"`
	Leader *Peer  `json:"leader,omitempty"`
}

type Scope added in v0.7.2

type Scope struct {
	Start []byte `json:"start"`
	End   []byte `json:"end"`
}

type SqlApply added in v0.6.3

type SqlApply struct {
	Id         string `json:"id"`
	DbName     string `json:"db_name"`
	TableName  string `json:"table_name"`
	Sentence   string `json:"sentence"`
	Status     int8   `json:"status"`
	Applyer    string `json:"applyer"`
	Auditor    string `json:"auditor"`
	CreateTime int64  `json:"create_time"`
	Remark     string `json:"remark"`
}

type TableInfo

type TableInfo struct {
	Id         int          `json:"id"`
	TableName  string       `json:"name"`
	DbId       int          `json:"db_id"`
	DbName     string       `json:"db_name"`
	Columns    []ColumnInfo `json:"columns"`
	Epoch      Epoch        `json:"epoch"`
	CreateTime int64        `json:"create_time"`
	Status     int          `json:"status"`
}

type UserInfo

type UserInfo struct {
	Id       string
	Erp      string
	Mail     string
	Tel      string
	UserName string
	RealName string
	// SuperiorId			string
	SuperiorName     string
	Department1      string
	Department2      string
	OrganizationName string
	CreateTime       string
	ModifyDate       string
}

func NewUserInfo

func NewUserInfo() *UserInfo

type UserPrivilege

type UserPrivilege struct {
	UserName  string `json:"user_name"`
	ClusterId uint64 `json:"cluster_id"`
	Privilege uint64 `json:"privilege"`
}

func NewUserPrivilege

func NewUserPrivilege() *UserPrivilege

Jump to

Keyboard shortcuts

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