v1

package
v0.0.0-...-d4bf905 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	SQLService_Query_FullMethodName = "/sql_engine.v1.SQLService/Query"
)

Variables

View Source
var File_v1_sql_service_proto protoreflect.FileDescriptor
View Source
var SQLService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sql_engine.v1.SQLService",
	HandlerType: (*SQLServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Query",
			Handler:    _SQLService_Query_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "v1/sql_service.proto",
}

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

Functions

func RegisterSQLServiceHandler

func RegisterSQLServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSQLServiceHandler registers the http handlers for service SQLService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSQLServiceHandlerClient

func RegisterSQLServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SQLServiceClient) error

RegisterSQLServiceHandlerClient registers the http handlers for service SQLService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SQLServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SQLServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SQLServiceClient" to call the correct interceptors.

func RegisterSQLServiceHandlerFromEndpoint

func RegisterSQLServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSQLServiceHandlerFromEndpoint is same as RegisterSQLServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSQLServiceHandlerServer

func RegisterSQLServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SQLServiceServer) error

RegisterSQLServiceHandlerServer registers the http handlers for service SQLService to "mux". UnaryRPC :call SQLServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSQLServiceHandlerFromEndpoint instead.

func RegisterSQLServiceServer

func RegisterSQLServiceServer(s grpc.ServiceRegistrar, srv SQLServiceServer)

Types

type QueryRequest

type QueryRequest struct {

	// The name is the instance name to execute the query against.
	// Format: instances/{instance}/databases/{databaseName}
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The SQL statement to execute.
	Statement string `protobuf:"bytes,2,opt,name=statement,proto3" json:"statement,omitempty"`
	// The SQL statement to execute.
	Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	// The timeout for the request.
	Timeout *durationpb.Duration `protobuf:"bytes,4,opt,name=timeout,proto3,oneof" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRequest) Descriptor deprecated

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

Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.

func (*QueryRequest) GetLimit

func (x *QueryRequest) GetLimit() int32

func (*QueryRequest) GetName

func (x *QueryRequest) GetName() string

func (*QueryRequest) GetStatement

func (x *QueryRequest) GetStatement() string

func (*QueryRequest) GetTimeout

func (x *QueryRequest) GetTimeout() *durationpb.Duration

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 {
	QueryResult *QueryResult `protobuf:"bytes,1,opt,name=query_result,json=queryResult,proto3" json:"query_result,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryResponse) Descriptor deprecated

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

Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.

func (*QueryResponse) GetQueryResult

func (x *QueryResponse) GetQueryResult() *QueryResult

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 QueryResult

type QueryResult struct {

	// Column names of the query result.
	ColumnNames []string `protobuf:"bytes,1,rep,name=column_names,json=columnNames,proto3" json:"column_names,omitempty"`
	// Column types of the query result.
	// The types come from the Golang SQL driver.
	ColumnTypeNames []string `protobuf:"bytes,2,rep,name=column_type_names,json=columnTypeNames,proto3" json:"column_type_names,omitempty"`
	// Rows of the query result.
	Rows []*QueryRow `protobuf:"bytes,3,rep,name=rows,proto3" json:"rows,omitempty"`
	// The error message if the query failed.
	Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
	// The time it takes to execute the query.
	Latency *durationpb.Duration `protobuf:"bytes,5,opt,name=latency,proto3" json:"latency,omitempty"`
	// The query statement for the result.
	Statement string `protobuf:"bytes,6,opt,name=statement,proto3" json:"statement,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryResult) Descriptor deprecated

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

Deprecated: Use QueryResult.ProtoReflect.Descriptor instead.

func (*QueryResult) GetColumnNames

func (x *QueryResult) GetColumnNames() []string

func (*QueryResult) GetColumnTypeNames

func (x *QueryResult) GetColumnTypeNames() []string

func (*QueryResult) GetError

func (x *QueryResult) GetError() string

func (*QueryResult) GetLatency

func (x *QueryResult) GetLatency() *durationpb.Duration

func (*QueryResult) GetRows

func (x *QueryResult) GetRows() []*QueryRow

func (*QueryResult) GetStatement

func (x *QueryResult) GetStatement() string

func (*QueryResult) ProtoMessage

func (*QueryResult) ProtoMessage()

func (*QueryResult) ProtoReflect

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

func (*QueryResult) Reset

func (x *QueryResult) Reset()

func (*QueryResult) String

func (x *QueryResult) String() string

type QueryRow

type QueryRow struct {

	// Row values of the query result.
	Values []*RowValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRow) Descriptor deprecated

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

Deprecated: Use QueryRow.ProtoReflect.Descriptor instead.

func (*QueryRow) GetValues

func (x *QueryRow) GetValues() []*RowValue

func (*QueryRow) ProtoMessage

func (*QueryRow) ProtoMessage()

func (*QueryRow) ProtoReflect

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

func (*QueryRow) Reset

func (x *QueryRow) Reset()

func (*QueryRow) String

func (x *QueryRow) String() string

type RowValue

type RowValue struct {

	// Types that are assignable to Kind:
	//
	//	*RowValue_NullValue
	//	*RowValue_BoolValue
	//	*RowValue_BytesValue
	//	*RowValue_DoubleValue
	//	*RowValue_FloatValue
	//	*RowValue_Int32Value
	//	*RowValue_Int64Value
	//	*RowValue_StringValue
	//	*RowValue_Uint32Value
	//	*RowValue_Uint64Value
	//	*RowValue_ValueValue
	Kind isRowValue_Kind `protobuf_oneof:"kind"`
	// contains filtered or unexported fields
}

func (*RowValue) Descriptor deprecated

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

Deprecated: Use RowValue.ProtoReflect.Descriptor instead.

func (*RowValue) GetBoolValue

func (x *RowValue) GetBoolValue() bool

func (*RowValue) GetBytesValue

func (x *RowValue) GetBytesValue() []byte

func (*RowValue) GetDoubleValue

func (x *RowValue) GetDoubleValue() float64

func (*RowValue) GetFloatValue

func (x *RowValue) GetFloatValue() float32

func (*RowValue) GetInt32Value

func (x *RowValue) GetInt32Value() int32

func (*RowValue) GetInt64Value

func (x *RowValue) GetInt64Value() int64

func (*RowValue) GetKind

func (m *RowValue) GetKind() isRowValue_Kind

func (*RowValue) GetNullValue

func (x *RowValue) GetNullValue() structpb.NullValue

func (*RowValue) GetStringValue

func (x *RowValue) GetStringValue() string

func (*RowValue) GetUint32Value

func (x *RowValue) GetUint32Value() uint32

func (*RowValue) GetUint64Value

func (x *RowValue) GetUint64Value() uint64

func (*RowValue) GetValueValue

func (x *RowValue) GetValueValue() *structpb.Value

func (*RowValue) ProtoMessage

func (*RowValue) ProtoMessage()

func (*RowValue) ProtoReflect

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

func (*RowValue) Reset

func (x *RowValue) Reset()

func (*RowValue) String

func (x *RowValue) String() string

type RowValue_BoolValue

type RowValue_BoolValue struct {
	BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"`
}

type RowValue_BytesValue

type RowValue_BytesValue struct {
	BytesValue []byte `protobuf:"bytes,3,opt,name=bytes_value,json=bytesValue,proto3,oneof"`
}

type RowValue_DoubleValue

type RowValue_DoubleValue struct {
	DoubleValue float64 `protobuf:"fixed64,4,opt,name=double_value,json=doubleValue,proto3,oneof"`
}

type RowValue_FloatValue

type RowValue_FloatValue struct {
	FloatValue float32 `protobuf:"fixed32,5,opt,name=float_value,json=floatValue,proto3,oneof"`
}

type RowValue_Int32Value

type RowValue_Int32Value struct {
	Int32Value int32 `protobuf:"varint,6,opt,name=int32_value,json=int32Value,proto3,oneof"`
}

type RowValue_Int64Value

type RowValue_Int64Value struct {
	Int64Value int64 `protobuf:"varint,7,opt,name=int64_value,json=int64Value,proto3,oneof"`
}

type RowValue_NullValue

type RowValue_NullValue struct {
	NullValue structpb.NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
}

type RowValue_StringValue

type RowValue_StringValue struct {
	StringValue string `protobuf:"bytes,8,opt,name=string_value,json=stringValue,proto3,oneof"`
}

type RowValue_Uint32Value

type RowValue_Uint32Value struct {
	Uint32Value uint32 `protobuf:"varint,9,opt,name=uint32_value,json=uint32Value,proto3,oneof"`
}

type RowValue_Uint64Value

type RowValue_Uint64Value struct {
	Uint64Value uint64 `protobuf:"varint,10,opt,name=uint64_value,json=uint64Value,proto3,oneof"`
}

type RowValue_ValueValue

type RowValue_ValueValue struct {
	// value_value is used for Spanner and TUPLE ARRAY MAP in Clickhouse only.
	ValueValue *structpb.Value `protobuf:"bytes,11,opt,name=value_value,json=valueValue,proto3,oneof"`
}

type SQLServiceClient

type SQLServiceClient interface {
	Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
}

SQLServiceClient is the client API for SQLService 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 NewSQLServiceClient

func NewSQLServiceClient(cc grpc.ClientConnInterface) SQLServiceClient

type SQLServiceServer

type SQLServiceServer interface {
	Query(context.Context, *QueryRequest) (*QueryResponse, error)
	// contains filtered or unexported methods
}

SQLServiceServer is the server API for SQLService service. All implementations must embed UnimplementedSQLServiceServer for forward compatibility

type UnimplementedSQLServiceServer

type UnimplementedSQLServiceServer struct {
}

UnimplementedSQLServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSQLServiceServer) Query

type UnsafeSQLServiceServer

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

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

Jump to

Keyboard shortcuts

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