v1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DBService_Query_FullMethodName = "/store_service.v1.DBService/Query"
	DBService_Exec_FullMethodName  = "/store_service.v1.DBService/Exec"
	DBService_Tx_FullMethodName    = "/store_service.v1.DBService/Tx"
)

Variables

View Source
var DBService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "store_service.v1.DBService",
	HandlerType: (*DBServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Query",
			Handler:    _DBService_Query_Handler,
		},
		{
			MethodName: "Exec",
			Handler:    _DBService_Exec_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Tx",
			Handler:       _DBService_Tx_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "api/store_service/v1/store_service.proto",
}

DBService_ServiceDesc is the grpc.ServiceDesc for DBService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_api_store_service_v1_store_service_proto protoreflect.FileDescriptor

Functions

func RegisterDBServiceServer

func RegisterDBServiceServer(s grpc.ServiceRegistrar, srv DBServiceServer)

Types

type DBServiceClient

type DBServiceClient interface {
	Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
	Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error)
	Tx(ctx context.Context, opts ...grpc.CallOption) (DBService_TxClient, error)
}

DBServiceClient is the client API for DBService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewDBServiceClient

func NewDBServiceClient(cc grpc.ClientConnInterface) DBServiceClient

type DBServiceServer

type DBServiceServer interface {
	Query(context.Context, *QueryRequest) (*QueryResponse, error)
	Exec(context.Context, *ExecRequest) (*ExecResponse, error)
	Tx(DBService_TxServer) error
	// contains filtered or unexported methods
}

DBServiceServer is the server API for DBService service. All implementations must embed UnimplementedDBServiceServer for forward compatibility

type DBService_TxClient

type DBService_TxClient interface {
	Send(*TxRequest) error
	Recv() (*TxResponse, error)
	grpc.ClientStream
}

type DBService_TxServer

type DBService_TxServer interface {
	Send(*TxResponse) error
	Recv() (*TxRequest, error)
	grpc.ServerStream
}

type ExecRequest

type ExecRequest struct {
	Name   string        `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`     //api名称
	Params *SimpleParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` // 用于拼凑where s
	// contains filtered or unexported fields
}

处理增删改

func (*ExecRequest) Descriptor deprecated

func (*ExecRequest) Descriptor() ([]byte, []int)

Deprecated: Use ExecRequest.ProtoReflect.Descriptor instead.

func (*ExecRequest) GetName

func (x *ExecRequest) GetName() string

func (*ExecRequest) GetParams

func (x *ExecRequest) GetParams() *SimpleParams

func (*ExecRequest) ProtoMessage

func (*ExecRequest) ProtoMessage()

func (*ExecRequest) ProtoReflect

func (x *ExecRequest) ProtoReflect() protoreflect.Message

func (*ExecRequest) Reset

func (x *ExecRequest) Reset()

func (*ExecRequest) String

func (x *ExecRequest) String() string

type ExecResponse

type ExecResponse struct {
	Message      string           `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`                                //结果描述
	RowsAffected int64            `protobuf:"varint,2,opt,name=rows_affected,json=rowsAffected,proto3" json:"rows_affected,omitempty"` // 受影响的行
	Select       *structpb.Struct `protobuf:"bytes,3,opt,name=select,proto3" json:"select,omitempty"`                                  //这里可以执行设置 执行完exec 之后要取的值
	// contains filtered or unexported fields
}

func (*ExecResponse) Descriptor deprecated

func (*ExecResponse) Descriptor() ([]byte, []int)

Deprecated: Use ExecResponse.ProtoReflect.Descriptor instead.

func (*ExecResponse) GetMessage

func (x *ExecResponse) GetMessage() string

func (*ExecResponse) GetRowsAffected

func (x *ExecResponse) GetRowsAffected() int64

func (*ExecResponse) GetSelect

func (x *ExecResponse) GetSelect() *structpb.Struct

func (*ExecResponse) ProtoMessage

func (*ExecResponse) ProtoMessage()

func (*ExecResponse) ProtoReflect

func (x *ExecResponse) ProtoReflect() protoreflect.Message

func (*ExecResponse) Reset

func (x *ExecResponse) Reset()

func (*ExecResponse) String

func (x *ExecResponse) String() string

type QueryRequest

type QueryRequest struct {
	Name   string        `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Params *SimpleParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRequest) Descriptor deprecated

func (*QueryRequest) Descriptor() ([]byte, []int)

Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.

func (*QueryRequest) GetName

func (x *QueryRequest) GetName() string

func (*QueryRequest) GetParams

func (x *QueryRequest) GetParams() *SimpleParams

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) ProtoReflect

func (x *QueryRequest) ProtoReflect() protoreflect.Message

func (*QueryRequest) Reset

func (x *QueryRequest) Reset()

func (*QueryRequest) String

func (x *QueryRequest) String() string

type QueryResponse

type QueryResponse struct {
	Message string             `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Result  []*structpb.Struct `protobuf:"bytes,2,rep,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryResponse) Descriptor deprecated

func (*QueryResponse) Descriptor() ([]byte, []int)

Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.

func (*QueryResponse) GetMessage

func (x *QueryResponse) GetMessage() string

func (*QueryResponse) GetResult

func (x *QueryResponse) GetResult() []*structpb.Struct

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) ProtoReflect

func (x *QueryResponse) ProtoReflect() protoreflect.Message

func (*QueryResponse) Reset

func (x *QueryResponse) Reset()

func (*QueryResponse) String

func (x *QueryResponse) String() string

type SimpleParams

type SimpleParams struct {
	Params *structpb.Struct `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
	// contains filtered or unexported fields
}

func (*SimpleParams) Descriptor deprecated

func (*SimpleParams) Descriptor() ([]byte, []int)

Deprecated: Use SimpleParams.ProtoReflect.Descriptor instead.

func (*SimpleParams) GetParams

func (x *SimpleParams) GetParams() *structpb.Struct

func (*SimpleParams) ProtoMessage

func (*SimpleParams) ProtoMessage()

func (*SimpleParams) ProtoReflect

func (x *SimpleParams) ProtoReflect() protoreflect.Message

func (*SimpleParams) Reset

func (x *SimpleParams) Reset()

func (*SimpleParams) String

func (x *SimpleParams) String() string

type TxRequest

type TxRequest struct {
	Api    string        `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` //传入api的name
	Params *SimpleParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"`
	Type   string        `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // 支持两种 1 query 2 exec
	// contains filtered or unexported fields
}

处理事务类操作

func (*TxRequest) Descriptor deprecated

func (*TxRequest) Descriptor() ([]byte, []int)

Deprecated: Use TxRequest.ProtoReflect.Descriptor instead.

func (*TxRequest) GetApi

func (x *TxRequest) GetApi() string

func (*TxRequest) GetParams

func (x *TxRequest) GetParams() *SimpleParams

func (*TxRequest) GetType

func (x *TxRequest) GetType() string

func (*TxRequest) ProtoMessage

func (*TxRequest) ProtoMessage()

func (*TxRequest) ProtoReflect

func (x *TxRequest) ProtoReflect() protoreflect.Message

func (*TxRequest) Reset

func (x *TxRequest) Reset()

func (*TxRequest) String

func (x *TxRequest) String() string

type TxResponse

type TxResponse struct {
	Result *structpb.Struct `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` //结果集
	// contains filtered or unexported fields
}

func (*TxResponse) Descriptor deprecated

func (*TxResponse) Descriptor() ([]byte, []int)

Deprecated: Use TxResponse.ProtoReflect.Descriptor instead.

func (*TxResponse) GetResult

func (x *TxResponse) GetResult() *structpb.Struct

func (*TxResponse) ProtoMessage

func (*TxResponse) ProtoMessage()

func (*TxResponse) ProtoReflect

func (x *TxResponse) ProtoReflect() protoreflect.Message

func (*TxResponse) Reset

func (x *TxResponse) Reset()

func (*TxResponse) String

func (x *TxResponse) String() string

type UnimplementedDBServiceServer

type UnimplementedDBServiceServer struct {
}

UnimplementedDBServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedDBServiceServer) Exec

func (UnimplementedDBServiceServer) Query

func (UnimplementedDBServiceServer) Tx

type UnsafeDBServiceServer

type UnsafeDBServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeDBServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DBServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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