Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateError(key int, a ...interface{}) *mft.Error
- func GenerateErrorE(key int, err error, a ...interface{}) *mft.Error
- func HttpExternalClusterLoadGenerator(ctx context.Context, compressor *compress.Generator, ...) (cluster.Cluster, *mft.Error)
- func HttpExternalClusterNewGenerator(ctx context.Context, compressor *compress.Generator, ...) (ecld *cluster.ExternalClusterLoadDescription, err *mft.Error)
- func QueueAddUnique(queueName string, message []byte, externalID int64, externalDt int64, ...) ...
- func QueueAddUniqueList(queueName string, messages []queue.Message, saveMode cn.SaveMode, ...) ...
- type ClusterConnection
- func (cc *ClusterConnection) CPAuthentificationInfo()
- func (cc *ClusterConnection) CallFunc() ...
- func (cc *ClusterConnection) Cluster() *cluster.ExternalAbstractCluster
- func (cc *ClusterConnection) GetName() string
- func (cc *ClusterConnection) Init()
- func (cc *ClusterConnection) ToJson() json.RawMessage
- type ConGroup
- func (cg *ConGroup) AddConnection(name string, connection *ClusterConnection) *ConGroup
- func (cg *ConGroup) FuncDO(ctx context.Context, pgName string, ...) (err *mft.Error)
- func (cg *ConGroup) FuncDOName(ctx context.Context, conName string, ...) (err *mft.Error)
- func (cg *ConGroup) Init(compressor *compress.Generator) *ConGroup
- func (cg *ConGroup) Ping(ctx context.Context, errFunc func(err *mft.Error))
- func (cg *ConGroup) ToJson() json.RawMessage
- type Connection
- type PriorityGroup
- type PriorityGroupStep
Constants ¶
View Source
const ( CompressTypeHeader = "Compress-Type" ClusterMethodPath = "/cluster" )
View Source
const (
HttpExternalClusterType = "http_cluster"
)
Variables ¶
View Source
var Errors map[int]string = map[int]string{
10190000: "ConnectionFromJson: Unmarshal fail",
10190001: "Connection.DoRawQuery: request create error server: %v",
10190002: "Connection.DoRawQuery: send request error server: %v",
10190003: "Connection.DoRawQuery: send request read body fail server: %v",
10190100: "ClusterConnection.CallFunc: Marshal request fail",
10190101: "ClusterConnection.CallFunc: Compress request fail",
10190102: "ClusterConnection.CallFunc: Send request fail",
10190103: "ClusterConnection.CallFunc: Responce code is not 200 responce code is: %v body: %v",
10190104: "ClusterConnection.CallFunc: Restore responce fail",
10190106: "ClusterConnection.CallFunc: Unmarshal responce fail",
10190200: "ClusterConnection.ToJson: marshal error",
10190300: "HttpExternalClusterNewGenerator: unmarshal error ec.name: %v",
10190301: "HttpExternalClusterNewGenerator: connection should be set (ClusterConnection.Connection) ec.name: %v",
10190302: "HttpExternalClusterNewGenerator: Connection.QueryWait should be > 0 ec.name: %v value: %v",
10190303: "HttpExternalClusterNewGenerator: Connection.Server should be set ec.name: %v",
10190304: "HttpExternalClusterNewGenerator: encrypt AuthentificationInfo fail ec.name: %v",
10190305: "HttpExternalClusterNewGenerator: DecryptAlg ia not correct ec.name: %v. Actual %v != Expired %v",
10190306: "HttpExternalClusterNewGenerator: params marshal fail ec.name: %v",
10190400: "HttpExternalClusterLoadGenerator: unmarshal error ec.name: %v",
10190401: "HttpExternalClusterLoadGenerator: connection should be set (ClusterConnection.Connection) ec.name: %v",
10190402: "HttpExternalClusterLoadGenerator: decrypt AuthentificationInfo fail ec.name: %v",
10191000: "ConGroup.ToJson: marshal error",
10191010: "ConGroupFromJson: unmarshal error",
10191100: "ConGroup.FuncDO: send fail %v of %v",
10191101: "ConGroup.FuncDO: Acquire semaphore send fail %v of %v",
10191102: "ConGroup.FuncDO: Execute on cluser %v failed",
10191103: "ConGroup.FuncDO: Priority Group with name %v does not exists",
10191104: "ConGroup.FuncDO: Cluster with name %v does not exists; done %v of %v",
10191130: "ConGroup.FuncDOName: Cluster with name %v does not exists",
10191200: "QueueAddUnique: Queue `%v` does not exists",
10191201: "QueueAddUnique: Queue `%v` get error",
10191202: "QueueAddUnique: Queue `%v` AddUnique error",
10191210: "QueueAddUniqueList: Queue `%v` does not exists",
10191211: "QueueAddUniqueList: Queue `%v` get error",
10191212: "QueueAddUniqueList: Queue `%v` AddUnique error",
}
Errors codes and description
Functions ¶
func GenerateErrorE ¶
GenerateErrorE -
func HttpExternalClusterNewGenerator ¶
func HttpExternalClusterNewGenerator( ctx context.Context, compressor *compress.Generator, ecDescription cluster.ExternalClusterDescription, idGenerator *mft.G, encryptData *cluster.EncryptData, ) (ecld *cluster.ExternalClusterLoadDescription, err *mft.Error)
func QueueAddUnique ¶
Types ¶
type ClusterConnection ¶
type ClusterConnection struct { Compressor *compress.Generator `json:"-"` Connection *Connection `json:"connection"` AuthentificationType string `json:"auth_type"` AuthentificationInfo []byte `json:"auth_info"` UserName string `json:"user_name"` PreferContentType string `json:"prefer_content_type"` SendContentType string `json:"send_content_type"` // ReplaceNameForce: replace username in request to UserName ReplaceNameForce bool `json:"replace_name_force"` AuthentificationInfoDecrypt []byte `json:"-"` }
func CreateClusterConnection ¶
func CreateClusterConnection(compressor *compress.Generator, connection *Connection, authentificationType string, userName string, authentificationInfo json.RawMessage, preferContentType string, sendContentType string, replaceNameForce bool, ) (cc *ClusterConnection)
func (*ClusterConnection) CPAuthentificationInfo ¶
func (cc *ClusterConnection) CPAuthentificationInfo()
func (*ClusterConnection) CallFunc ¶
func (cc *ClusterConnection) CallFunc() func(ctx context.Context, request *cluster.RequestBody) (responce *cluster.ResponceBody)
func (*ClusterConnection) Cluster ¶
func (cc *ClusterConnection) Cluster() *cluster.ExternalAbstractCluster
func (*ClusterConnection) GetName ¶
func (cc *ClusterConnection) GetName() string
func (*ClusterConnection) Init ¶
func (cc *ClusterConnection) Init()
func (*ClusterConnection) ToJson ¶
func (cc *ClusterConnection) ToJson() json.RawMessage
type ConGroup ¶
type ConGroup struct { ConnectionsInfo map[string]*ClusterConnection `json:"connections"` HealthCheck map[string]bool `json:"-"` Clusters map[string]*cluster.ExternalAbstractCluster `json:"-"` PriorityGroups map[string]*PriorityGroup `json:"priority_groups"` // contains filtered or unexported fields }
ConGroup - Cluster connection group
func ConGroupFromJson ¶
func ConGroupGenerate ¶
func ConGroupGenerate() (cg *ConGroup)
func (*ConGroup) AddConnection ¶
func (cg *ConGroup) AddConnection(name string, connection *ClusterConnection) *ConGroup
func (*ConGroup) FuncDOName ¶
func (*ConGroup) ToJson ¶
func (cg *ConGroup) ToJson() json.RawMessage
type Connection ¶
type Connection struct { Server string `json:"server"` IgnoreSSLValidation bool `json:"ignore_ssql_validation"` QueryWait time.Duration `json:"query_wait"` MaxConnsPerHost int `json:"max_conn"` MaxIdleConnDuration time.Duration `json:"max_idle_duration"` // contains filtered or unexported fields }
Connection - to host
func ConnectionFromJson ¶
func ConnectionFromJson(body []byte) (c *Connection, err *mft.Error)
func CreateConnection ¶
type PriorityGroup ¶
type PriorityGroup struct { MinSuccess int `json:"min_success"` Steps []PriorityGroupStep `json:"step"` }
Click to show internal directories.
Click to hide internal directories.