Documentation ¶
Overview ¶
Package proto is a generated protocol buffer package.
It is generated from these files:
driver.proto
It has these top-level messages:
DSN Rule Param InitRequest Empty ExecRequest ExecResponse TxRequest TxResponse DatabasesResponse ParseRequest Node ParseResponse AuditRequest AuditResult AuditResponse GenRollbackSQLRequest GenRollbackSQLResponse MetasResponse
Index ¶
- func ConvertProtoParamToParam(p []*Param) params.Params
- func RegisterDriverServer(s *grpc.Server, srv DriverServer)
- type AuditRequest
- type AuditResponse
- type AuditResult
- type DSN
- func (*DSN) Descriptor() ([]byte, []int)
- func (m *DSN) GetAdditionalParams() []*Param
- func (m *DSN) GetDatabase() string
- func (m *DSN) GetHost() string
- func (m *DSN) GetPassword() string
- func (m *DSN) GetPort() string
- func (m *DSN) GetUser() string
- func (*DSN) ProtoMessage()
- func (m *DSN) Reset()
- func (m *DSN) String() string
- type DatabasesResponse
- type DriverClient
- type DriverServer
- type Empty
- type ExecRequest
- type ExecResponse
- func (*ExecResponse) Descriptor() ([]byte, []int)
- func (m *ExecResponse) GetLastInsertId() int64
- func (m *ExecResponse) GetLastInsertIdError() string
- func (m *ExecResponse) GetRowsAffected() int64
- func (m *ExecResponse) GetRowsAffectedError() string
- func (*ExecResponse) ProtoMessage()
- func (m *ExecResponse) Reset()
- func (m *ExecResponse) String() string
- type GenRollbackSQLRequest
- type GenRollbackSQLResponse
- type InitRequest
- type MetasResponse
- type Node
- type Param
- type ParseRequest
- type ParseResponse
- type Rule
- func (*Rule) Descriptor() ([]byte, []int)
- func (m *Rule) GetCategory() string
- func (m *Rule) GetDesc() string
- func (m *Rule) GetLevel() string
- func (m *Rule) GetName() string
- func (m *Rule) GetParams() []*Param
- func (m *Rule) GetValue() string
- func (*Rule) ProtoMessage()
- func (m *Rule) Reset()
- func (m *Rule) String() string
- type TxRequest
- type TxResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertProtoParamToParam ¶ added in v1.2203.0
func RegisterDriverServer ¶
func RegisterDriverServer(s *grpc.Server, srv DriverServer)
Types ¶
type AuditRequest ¶
type AuditRequest struct {
Sql string `protobuf:"bytes,1,opt,name=sql" json:"sql,omitempty"`
}
func (*AuditRequest) Descriptor ¶
func (*AuditRequest) Descriptor() ([]byte, []int)
func (*AuditRequest) GetSql ¶
func (m *AuditRequest) GetSql() string
func (*AuditRequest) ProtoMessage ¶
func (*AuditRequest) ProtoMessage()
func (*AuditRequest) Reset ¶
func (m *AuditRequest) Reset()
func (*AuditRequest) String ¶
func (m *AuditRequest) String() string
type AuditResponse ¶
type AuditResponse struct {
Results []*AuditResult `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"`
}
func (*AuditResponse) Descriptor ¶
func (*AuditResponse) Descriptor() ([]byte, []int)
func (*AuditResponse) GetResults ¶
func (m *AuditResponse) GetResults() []*AuditResult
func (*AuditResponse) ProtoMessage ¶
func (*AuditResponse) ProtoMessage()
func (*AuditResponse) Reset ¶
func (m *AuditResponse) Reset()
func (*AuditResponse) String ¶
func (m *AuditResponse) String() string
type AuditResult ¶
type AuditResult struct { Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` Level string `protobuf:"bytes,2,opt,name=level" json:"level,omitempty"` }
func (*AuditResult) Descriptor ¶
func (*AuditResult) Descriptor() ([]byte, []int)
func (*AuditResult) GetLevel ¶
func (m *AuditResult) GetLevel() string
func (*AuditResult) GetMessage ¶
func (m *AuditResult) GetMessage() string
func (*AuditResult) ProtoMessage ¶
func (*AuditResult) ProtoMessage()
func (*AuditResult) Reset ¶
func (m *AuditResult) Reset()
func (*AuditResult) String ¶
func (m *AuditResult) String() string
type DSN ¶ added in v1.2111.0
type DSN struct { Host string `protobuf:"bytes,1,opt,name=host" json:"host,omitempty"` Port string `protobuf:"bytes,2,opt,name=port" json:"port,omitempty"` User string `protobuf:"bytes,3,opt,name=user" json:"user,omitempty"` Password string `protobuf:"bytes,4,opt,name=password" json:"password,omitempty"` Database string `protobuf:"bytes,5,opt,name=database" json:"database,omitempty"` AdditionalParams []*Param `protobuf:"bytes,6,rep,name=additionalParams" json:"additionalParams,omitempty"` }
func (*DSN) Descriptor ¶ added in v1.2111.0
func (*DSN) GetAdditionalParams ¶ added in v1.2203.0
func (*DSN) GetDatabase ¶ added in v1.2111.0
func (*DSN) GetPassword ¶ added in v1.2111.0
func (*DSN) ProtoMessage ¶ added in v1.2111.0
func (*DSN) ProtoMessage()
type DatabasesResponse ¶
type DatabasesResponse struct {
Databases []string `protobuf:"bytes,1,rep,name=databases" json:"databases,omitempty"`
}
func (*DatabasesResponse) Descriptor ¶
func (*DatabasesResponse) Descriptor() ([]byte, []int)
func (*DatabasesResponse) GetDatabases ¶
func (m *DatabasesResponse) GetDatabases() []string
func (*DatabasesResponse) ProtoMessage ¶
func (*DatabasesResponse) ProtoMessage()
func (*DatabasesResponse) Reset ¶
func (m *DatabasesResponse) Reset()
func (*DatabasesResponse) String ¶
func (m *DatabasesResponse) String() string
type DriverClient ¶
type DriverClient interface { // Metas returns some base info from plugin server. Metas(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*MetasResponse, error) // Init will should be called at first before calling following methods. // It will pass some necessary info to plugin server. In the beginning, // we consider that put this info to the executable binary environment. // We put all communication on gRPC for unification in the end. Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error) Close(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) Tx(ctx context.Context, in *TxRequest, opts ...grpc.CallOption) (*TxResponse, error) Databases(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DatabasesResponse, error) Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error) Audit(ctx context.Context, in *AuditRequest, opts ...grpc.CallOption) (*AuditResponse, error) GenRollbackSQL(ctx context.Context, in *GenRollbackSQLRequest, opts ...grpc.CallOption) (*GenRollbackSQLResponse, error) }
func NewDriverClient ¶
func NewDriverClient(cc *grpc.ClientConn) DriverClient
type DriverServer ¶
type DriverServer interface { // Metas returns some base info from plugin server. Metas(context.Context, *Empty) (*MetasResponse, error) // Init will should be called at first before calling following methods. // It will pass some necessary info to plugin server. In the beginning, // we consider that put this info to the executable binary environment. // We put all communication on gRPC for unification in the end. Init(context.Context, *InitRequest) (*Empty, error) Close(context.Context, *Empty) (*Empty, error) Ping(context.Context, *Empty) (*Empty, error) Exec(context.Context, *ExecRequest) (*ExecResponse, error) Tx(context.Context, *TxRequest) (*TxResponse, error) Databases(context.Context, *Empty) (*DatabasesResponse, error) Parse(context.Context, *ParseRequest) (*ParseResponse, error) Audit(context.Context, *AuditRequest) (*AuditResponse, error) GenRollbackSQL(context.Context, *GenRollbackSQLRequest) (*GenRollbackSQLResponse, error) }
type Empty ¶
type Empty struct { }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
type ExecRequest ¶
type ExecRequest struct {
Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"`
}
func (*ExecRequest) Descriptor ¶
func (*ExecRequest) Descriptor() ([]byte, []int)
func (*ExecRequest) GetQuery ¶
func (m *ExecRequest) GetQuery() string
func (*ExecRequest) ProtoMessage ¶
func (*ExecRequest) ProtoMessage()
func (*ExecRequest) Reset ¶
func (m *ExecRequest) Reset()
func (*ExecRequest) String ¶
func (m *ExecRequest) String() string
type ExecResponse ¶
type ExecResponse struct { LastInsertId int64 `protobuf:"varint,1,opt,name=lastInsertId" json:"lastInsertId,omitempty"` LastInsertIdError string `protobuf:"bytes,2,opt,name=lastInsertIdError" json:"lastInsertIdError,omitempty"` RowsAffected int64 `protobuf:"varint,3,opt,name=rowsAffected" json:"rowsAffected,omitempty"` RowsAffectedError string `protobuf:"bytes,4,opt,name=rowsAffectedError" json:"rowsAffectedError,omitempty"` }
func (*ExecResponse) Descriptor ¶
func (*ExecResponse) Descriptor() ([]byte, []int)
func (*ExecResponse) GetLastInsertId ¶
func (m *ExecResponse) GetLastInsertId() int64
func (*ExecResponse) GetLastInsertIdError ¶
func (m *ExecResponse) GetLastInsertIdError() string
func (*ExecResponse) GetRowsAffected ¶
func (m *ExecResponse) GetRowsAffected() int64
func (*ExecResponse) GetRowsAffectedError ¶
func (m *ExecResponse) GetRowsAffectedError() string
func (*ExecResponse) ProtoMessage ¶
func (*ExecResponse) ProtoMessage()
func (*ExecResponse) Reset ¶
func (m *ExecResponse) Reset()
func (*ExecResponse) String ¶
func (m *ExecResponse) String() string
type GenRollbackSQLRequest ¶
type GenRollbackSQLRequest struct {
Sql string `protobuf:"bytes,1,opt,name=sql" json:"sql,omitempty"`
}
func (*GenRollbackSQLRequest) Descriptor ¶
func (*GenRollbackSQLRequest) Descriptor() ([]byte, []int)
func (*GenRollbackSQLRequest) GetSql ¶
func (m *GenRollbackSQLRequest) GetSql() string
func (*GenRollbackSQLRequest) ProtoMessage ¶
func (*GenRollbackSQLRequest) ProtoMessage()
func (*GenRollbackSQLRequest) Reset ¶
func (m *GenRollbackSQLRequest) Reset()
func (*GenRollbackSQLRequest) String ¶
func (m *GenRollbackSQLRequest) String() string
type GenRollbackSQLResponse ¶
type GenRollbackSQLResponse struct { Sql string `protobuf:"bytes,1,opt,name=sql" json:"sql,omitempty"` Reason string `protobuf:"bytes,2,opt,name=reason" json:"reason,omitempty"` }
func (*GenRollbackSQLResponse) Descriptor ¶
func (*GenRollbackSQLResponse) Descriptor() ([]byte, []int)
func (*GenRollbackSQLResponse) GetReason ¶
func (m *GenRollbackSQLResponse) GetReason() string
func (*GenRollbackSQLResponse) GetSql ¶
func (m *GenRollbackSQLResponse) GetSql() string
func (*GenRollbackSQLResponse) ProtoMessage ¶
func (*GenRollbackSQLResponse) ProtoMessage()
func (*GenRollbackSQLResponse) Reset ¶
func (m *GenRollbackSQLResponse) Reset()
func (*GenRollbackSQLResponse) String ¶
func (m *GenRollbackSQLResponse) String() string
type InitRequest ¶
type InitRequest struct { Dsn *DSN `protobuf:"bytes,1,opt,name=dsn" json:"dsn,omitempty"` Rules []*Rule `protobuf:"bytes,3,rep,name=rules" json:"rules,omitempty"` }
func (*InitRequest) Descriptor ¶
func (*InitRequest) Descriptor() ([]byte, []int)
func (*InitRequest) GetDsn ¶ added in v1.2111.0
func (m *InitRequest) GetDsn() *DSN
func (*InitRequest) GetRules ¶ added in v1.2111.0
func (m *InitRequest) GetRules() []*Rule
func (*InitRequest) ProtoMessage ¶
func (*InitRequest) ProtoMessage()
func (*InitRequest) Reset ¶
func (m *InitRequest) Reset()
func (*InitRequest) String ¶
func (m *InitRequest) String() string
type MetasResponse ¶
type MetasResponse struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Rules []*Rule `protobuf:"bytes,2,rep,name=rules" json:"rules,omitempty"` AdditionalParams []*Param `protobuf:"bytes,3,rep,name=additionalParams" json:"additionalParams,omitempty"` }
func (*MetasResponse) Descriptor ¶
func (*MetasResponse) Descriptor() ([]byte, []int)
func (*MetasResponse) GetAdditionalParams ¶ added in v1.2203.0
func (m *MetasResponse) GetAdditionalParams() []*Param
func (*MetasResponse) GetName ¶
func (m *MetasResponse) GetName() string
func (*MetasResponse) GetRules ¶
func (m *MetasResponse) GetRules() []*Rule
func (*MetasResponse) ProtoMessage ¶
func (*MetasResponse) ProtoMessage()
func (*MetasResponse) Reset ¶
func (m *MetasResponse) Reset()
func (*MetasResponse) String ¶
func (m *MetasResponse) String() string
type Node ¶
type Node struct { Text string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"` Fingerprint string `protobuf:"bytes,3,opt,name=fingerprint" json:"fingerprint,omitempty"` }
func (*Node) Descriptor ¶
func (*Node) GetFingerprint ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
type Param ¶ added in v1.2112.0
type Param struct { Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` Desc string `protobuf:"bytes,3,opt,name=desc" json:"desc,omitempty"` Type string `protobuf:"bytes,4,opt,name=type" json:"type,omitempty"` }
func ConvertParamToProtoParam ¶ added in v1.2203.0
func (*Param) Descriptor ¶ added in v1.2112.0
func (*Param) ProtoMessage ¶ added in v1.2112.0
func (*Param) ProtoMessage()
type ParseRequest ¶
type ParseRequest struct {
SqlText string `protobuf:"bytes,1,opt,name=sqlText" json:"sqlText,omitempty"`
}
func (*ParseRequest) Descriptor ¶
func (*ParseRequest) Descriptor() ([]byte, []int)
func (*ParseRequest) GetSqlText ¶
func (m *ParseRequest) GetSqlText() string
func (*ParseRequest) ProtoMessage ¶
func (*ParseRequest) ProtoMessage()
func (*ParseRequest) Reset ¶
func (m *ParseRequest) Reset()
func (*ParseRequest) String ¶
func (m *ParseRequest) String() string
type ParseResponse ¶
type ParseResponse struct {
Nodes []*Node `protobuf:"bytes,1,rep,name=nodes" json:"nodes,omitempty"`
}
func (*ParseResponse) Descriptor ¶
func (*ParseResponse) Descriptor() ([]byte, []int)
func (*ParseResponse) GetNodes ¶
func (m *ParseResponse) GetNodes() []*Node
func (*ParseResponse) ProtoMessage ¶
func (*ParseResponse) ProtoMessage()
func (*ParseResponse) Reset ¶
func (m *ParseResponse) Reset()
func (*ParseResponse) String ¶
func (m *ParseResponse) String() string
type Rule ¶
type Rule struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Desc string `protobuf:"bytes,2,opt,name=desc" json:"desc,omitempty"` Value string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` Level string `protobuf:"bytes,4,opt,name=level" json:"level,omitempty"` Category string `protobuf:"bytes,5,opt,name=category" json:"category,omitempty"` Params []*Param `protobuf:"bytes,6,rep,name=params" json:"params,omitempty"` }
func (*Rule) Descriptor ¶
func (*Rule) GetCategory ¶ added in v1.2111.0
func (*Rule) ProtoMessage ¶
func (*Rule) ProtoMessage()
type TxRequest ¶
type TxRequest struct {
Queries []string `protobuf:"bytes,1,rep,name=queries" json:"queries,omitempty"`
}
func (*TxRequest) Descriptor ¶
func (*TxRequest) GetQueries ¶
func (*TxRequest) ProtoMessage ¶
func (*TxRequest) ProtoMessage()
type TxResponse ¶
type TxResponse struct {
Results []*ExecResponse `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"`
}
func (*TxResponse) Descriptor ¶
func (*TxResponse) Descriptor() ([]byte, []int)
func (*TxResponse) GetResults ¶ added in v1.2112.0
func (m *TxResponse) GetResults() []*ExecResponse
func (*TxResponse) ProtoMessage ¶
func (*TxResponse) ProtoMessage()
func (*TxResponse) Reset ¶
func (m *TxResponse) Reset()
func (*TxResponse) String ¶
func (m *TxResponse) String() string
Click to show internal directories.
Click to hide internal directories.