Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer)
- type Agg
- type AggFunc
- type DataServiceClient
- type DataServiceServer
- type Filter
- type FilterOp
- type Group
- func (*Group) Descriptor() ([]byte, []int)deprecated
- func (x *Group) GetAggregates() map[string]*Value
- func (x *Group) GetKey() *Value
- func (x *Group) GetRows() []*Record
- func (*Group) ProtoMessage()
- func (x *Group) ProtoReflect() protoreflect.Message
- func (x *Group) Reset()
- func (x *Group) String() string
- type Kind
- type ListRequest
- type ListResponse
- type MutateResponse
- type Mutation
- func (*Mutation) Descriptor() ([]byte, []int)deprecated
- func (x *Mutation) GetKey() *Value
- func (x *Mutation) GetKind() MutationKind
- func (x *Mutation) GetRecord() *Record
- func (*Mutation) ProtoMessage()
- func (x *Mutation) ProtoReflect() protoreflect.Message
- func (x *Mutation) Reset()
- func (x *Mutation) String() string
- type MutationKind
- func (MutationKind) Descriptor() protoreflect.EnumDescriptor
- func (x MutationKind) Enum() *MutationKind
- func (MutationKind) EnumDescriptor() ([]byte, []int)deprecated
- func (x MutationKind) Number() protoreflect.EnumNumber
- func (x MutationKind) String() string
- func (MutationKind) Type() protoreflect.EnumType
- type Query
- func (*Query) Descriptor() ([]byte, []int)deprecated
- func (x *Query) GetAggs() []*Agg
- func (x *Query) GetFilters() []*Filter
- func (x *Query) GetGroupBy() string
- func (x *Query) GetLimit() int32
- func (x *Query) GetOffset() int32
- func (x *Query) GetSorts() []*Sort
- func (*Query) ProtoMessage()
- func (x *Query) ProtoReflect() protoreflect.Message
- func (x *Query) Reset()
- func (x *Query) String() string
- type Record
- type Sort
- type UnimplementedDataServiceServer
- type UnsafeDataServiceServer
- type Value
- func (*Value) Descriptor() ([]byte, []int)deprecated
- func (x *Value) GetBool() bool
- func (x *Value) GetFloat() float64
- func (x *Value) GetInt() int64
- func (x *Value) GetKind() Kind
- func (x *Value) GetStr() string
- func (*Value) ProtoMessage()
- func (x *Value) ProtoReflect() protoreflect.Message
- func (x *Value) Reset()
- func (x *Value) String() string
- type View
- func (*View) Descriptor() ([]byte, []int)deprecated
- func (x *View) GetAggregates() map[string]*Value
- func (x *View) GetGrouped() bool
- func (x *View) GetGroups() []*Group
- func (x *View) GetRows() []*Record
- func (x *View) GetTotal() int32
- func (*View) ProtoMessage()
- func (x *View) ProtoReflect() protoreflect.Message
- func (x *View) Reset()
- func (x *View) String() string
Constants ¶
const ( DataService_List_FullMethodName = "/datapb.DataService/List" DataService_Query_FullMethodName = "/datapb.DataService/Query" DataService_Mutate_FullMethodName = "/datapb.DataService/Mutate" )
Variables ¶
var ( Kind_name = map[int32]string{ 0: "KIND_STRING", 1: "KIND_INT", 2: "KIND_FLOAT", 3: "KIND_BOOL", } Kind_value = map[string]int32{ "KIND_STRING": 0, "KIND_INT": 1, "KIND_FLOAT": 2, "KIND_BOOL": 3, } )
Enum value maps for Kind.
var ( FilterOp_name = map[int32]string{ 0: "OP_EQ", 1: "OP_NE", 2: "OP_LT", 3: "OP_LE", 4: "OP_GT", 5: "OP_GE", 6: "OP_CONTAINS", } FilterOp_value = map[string]int32{ "OP_EQ": 0, "OP_NE": 1, "OP_LT": 2, "OP_LE": 3, "OP_GT": 4, "OP_GE": 5, "OP_CONTAINS": 6, } )
Enum value maps for FilterOp.
var ( AggFunc_name = map[int32]string{ 0: "AGG_COUNT", 1: "AGG_SUM", 2: "AGG_AVG", 3: "AGG_MIN", 4: "AGG_MAX", } AggFunc_value = map[string]int32{ "AGG_COUNT": 0, "AGG_SUM": 1, "AGG_AVG": 2, "AGG_MIN": 3, "AGG_MAX": 4, } )
Enum value maps for AggFunc.
var ( MutationKind_name = map[int32]string{ 0: "MUT_INSERT", 1: "MUT_UPDATE", 2: "MUT_DELETE", } MutationKind_value = map[string]int32{ "MUT_INSERT": 0, "MUT_UPDATE": 1, "MUT_DELETE": 2, } )
Enum value maps for MutationKind.
var DataService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "datapb.DataService", HandlerType: (*DataServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "List", Handler: _DataService_List_Handler, }, { MethodName: "Query", Handler: _DataService_Query_Handler, }, { MethodName: "Mutate", Handler: _DataService_Mutate_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/data.proto", }
DataService_ServiceDesc is the grpc.ServiceDesc for DataService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_data_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDataServiceServer ¶
func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer)
Types ¶
type Agg ¶
type Agg struct {
Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
Func AggFunc `protobuf:"varint,2,opt,name=func,proto3,enum=datapb.AggFunc" json:"func,omitempty"`
// contains filtered or unexported fields
}
func (*Agg) Descriptor
deprecated
func (*Agg) ProtoMessage ¶
func (*Agg) ProtoMessage()
func (*Agg) ProtoReflect ¶
func (x *Agg) ProtoReflect() protoreflect.Message
type AggFunc ¶
type AggFunc int32
AggFunc mirrors data.AggFunc.
func (AggFunc) Descriptor ¶
func (AggFunc) Descriptor() protoreflect.EnumDescriptor
func (AggFunc) EnumDescriptor
deprecated
func (AggFunc) Number ¶
func (x AggFunc) Number() protoreflect.EnumNumber
func (AggFunc) Type ¶
func (AggFunc) Type() protoreflect.EnumType
type DataServiceClient ¶
type DataServiceClient interface {
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
Query(ctx context.Context, in *Query, opts ...grpc.CallOption) (*View, error)
Mutate(ctx context.Context, in *Mutation, opts ...grpc.CallOption) (*MutateResponse, error)
}
DataServiceClient is the client API for DataService 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.
DataService is the small list/query/mutate contract a grpcproxy.Client speaks to a grpcproxy.Server. The Server delegates each call to any data.Proxy (a MemoryProxy in practice), so the same query pipeline runs server-side and the client gets back the identical View.
func NewDataServiceClient ¶
func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient
type DataServiceServer ¶
type DataServiceServer interface {
List(context.Context, *ListRequest) (*ListResponse, error)
Query(context.Context, *Query) (*View, error)
Mutate(context.Context, *Mutation) (*MutateResponse, error)
// contains filtered or unexported methods
}
DataServiceServer is the server API for DataService service. All implementations must embed UnimplementedDataServiceServer for forward compatibility.
DataService is the small list/query/mutate contract a grpcproxy.Client speaks to a grpcproxy.Server. The Server delegates each call to any data.Proxy (a MemoryProxy in practice), so the same query pipeline runs server-side and the client gets back the identical View.
type Filter ¶
type Filter struct {
Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
Op FilterOp `protobuf:"varint,2,opt,name=op,proto3,enum=datapb.FilterOp" json:"op,omitempty"`
Value *Value `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
func (*Filter) Descriptor
deprecated
func (*Filter) ProtoMessage ¶
func (*Filter) ProtoMessage()
func (*Filter) ProtoReflect ¶
func (x *Filter) ProtoReflect() protoreflect.Message
type FilterOp ¶
type FilterOp int32
FilterOp mirrors data.FilterOp.
func (FilterOp) Descriptor ¶
func (FilterOp) Descriptor() protoreflect.EnumDescriptor
func (FilterOp) EnumDescriptor
deprecated
func (FilterOp) Number ¶
func (x FilterOp) Number() protoreflect.EnumNumber
func (FilterOp) Type ¶
func (FilterOp) Type() protoreflect.EnumType
type Group ¶
type Group struct {
Key *Value `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Rows []*Record `protobuf:"bytes,2,rep,name=rows,proto3" json:"rows,omitempty"`
Aggregates map[string]*Value `` /* 147-byte string literal not displayed */
// contains filtered or unexported fields
}
Group mirrors data.Group.
func (*Group) Descriptor
deprecated
func (*Group) GetAggregates ¶
func (*Group) ProtoMessage ¶
func (*Group) ProtoMessage()
func (*Group) ProtoReflect ¶
func (x *Group) ProtoReflect() protoreflect.Message
type Kind ¶
type Kind int32
Kind mirrors data.Kind: the scalar type of a Value.
func (Kind) Descriptor ¶
func (Kind) Descriptor() protoreflect.EnumDescriptor
func (Kind) EnumDescriptor
deprecated
func (Kind) Number ¶
func (x Kind) Number() protoreflect.EnumNumber
func (Kind) Type ¶
func (Kind) Type() protoreflect.EnumType
type ListRequest ¶
type ListRequest struct {
// contains filtered or unexported fields
}
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ListResponse ¶
type ListResponse struct {
Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
// contains filtered or unexported fields
}
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetRecords ¶
func (x *ListResponse) GetRecords() []*Record
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
type MutateResponse ¶
type MutateResponse struct {
// contains filtered or unexported fields
}
func (*MutateResponse) Descriptor
deprecated
func (*MutateResponse) Descriptor() ([]byte, []int)
Deprecated: Use MutateResponse.ProtoReflect.Descriptor instead.
func (*MutateResponse) ProtoMessage ¶
func (*MutateResponse) ProtoMessage()
func (*MutateResponse) ProtoReflect ¶
func (x *MutateResponse) ProtoReflect() protoreflect.Message
func (*MutateResponse) Reset ¶
func (x *MutateResponse) Reset()
func (*MutateResponse) String ¶
func (x *MutateResponse) String() string
type Mutation ¶
type Mutation struct {
Kind MutationKind `protobuf:"varint,1,opt,name=kind,proto3,enum=datapb.MutationKind" json:"kind,omitempty"`
Record *Record `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"`
Key *Value `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
func (*Mutation) Descriptor
deprecated
func (*Mutation) GetKind ¶
func (x *Mutation) GetKind() MutationKind
func (*Mutation) ProtoMessage ¶
func (*Mutation) ProtoMessage()
func (*Mutation) ProtoReflect ¶
func (x *Mutation) ProtoReflect() protoreflect.Message
type MutationKind ¶
type MutationKind int32
MutationKind mirrors data.MutationKind.
const ( MutationKind_MUT_INSERT MutationKind = 0 MutationKind_MUT_UPDATE MutationKind = 1 MutationKind_MUT_DELETE MutationKind = 2 )
func (MutationKind) Descriptor ¶
func (MutationKind) Descriptor() protoreflect.EnumDescriptor
func (MutationKind) Enum ¶
func (x MutationKind) Enum() *MutationKind
func (MutationKind) EnumDescriptor
deprecated
func (MutationKind) EnumDescriptor() ([]byte, []int)
Deprecated: Use MutationKind.Descriptor instead.
func (MutationKind) Number ¶
func (x MutationKind) Number() protoreflect.EnumNumber
func (MutationKind) String ¶
func (x MutationKind) String() string
func (MutationKind) Type ¶
func (MutationKind) Type() protoreflect.EnumType
type Query ¶
type Query struct {
Filters []*Filter `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
Sorts []*Sort `protobuf:"bytes,2,rep,name=sorts,proto3" json:"sorts,omitempty"`
GroupBy string `protobuf:"bytes,3,opt,name=group_by,json=groupBy,proto3" json:"group_by,omitempty"`
Offset int32 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
Limit int32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
Aggs []*Agg `protobuf:"bytes,6,rep,name=aggs,proto3" json:"aggs,omitempty"`
// contains filtered or unexported fields
}
Query mirrors data.Query: filter, sort, group, page, aggregate.
func (*Query) Descriptor
deprecated
func (*Query) GetFilters ¶
func (*Query) GetGroupBy ¶
func (*Query) ProtoMessage ¶
func (*Query) ProtoMessage()
func (*Query) ProtoReflect ¶
func (x *Query) ProtoReflect() protoreflect.Message
type Record ¶
type Record struct {
Fields map[string]*Value `` /* 139-byte string literal not displayed */
// contains filtered or unexported fields
}
Record mirrors data.Record: a row of named cells.
func (*Record) Descriptor
deprecated
func (*Record) ProtoMessage ¶
func (*Record) ProtoMessage()
func (*Record) ProtoReflect ¶
func (x *Record) ProtoReflect() protoreflect.Message
type Sort ¶
type Sort struct {
Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
Desc bool `protobuf:"varint,2,opt,name=desc,proto3" json:"desc,omitempty"`
// contains filtered or unexported fields
}
func (*Sort) Descriptor
deprecated
func (*Sort) ProtoMessage ¶
func (*Sort) ProtoMessage()
func (*Sort) ProtoReflect ¶
func (x *Sort) ProtoReflect() protoreflect.Message
type UnimplementedDataServiceServer ¶
type UnimplementedDataServiceServer struct{}
UnimplementedDataServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedDataServiceServer) List ¶
func (UnimplementedDataServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
func (UnimplementedDataServiceServer) Mutate ¶
func (UnimplementedDataServiceServer) Mutate(context.Context, *Mutation) (*MutateResponse, error)
type UnsafeDataServiceServer ¶
type UnsafeDataServiceServer interface {
// contains filtered or unexported methods
}
UnsafeDataServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DataServiceServer will result in compilation errors.
type Value ¶
type Value struct {
Kind Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=datapb.Kind" json:"kind,omitempty"`
Str string `protobuf:"bytes,2,opt,name=str,proto3" json:"str,omitempty"`
Int int64 `protobuf:"varint,3,opt,name=int,proto3" json:"int,omitempty"`
Float float64 `protobuf:"fixed64,4,opt,name=float,proto3" json:"float,omitempty"`
Bool bool `protobuf:"varint,5,opt,name=bool,proto3" json:"bool,omitempty"`
// contains filtered or unexported fields
}
Value mirrors data.Value: a tagged scalar. Only the field named by kind is meaningful.
func (*Value) Descriptor
deprecated
func (*Value) ProtoMessage ¶
func (*Value) ProtoMessage()
func (*Value) ProtoReflect ¶
func (x *Value) ProtoReflect() protoreflect.Message
type View ¶
type View struct {
Rows []*Record `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows,omitempty"`
Groups []*Group `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"`
Total int32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
Aggregates map[string]*Value `` /* 147-byte string literal not displayed */
Grouped bool `protobuf:"varint,5,opt,name=grouped,proto3" json:"grouped,omitempty"`
// contains filtered or unexported fields
}
View mirrors data.View. The grouped flag distinguishes a grouped view (whose Rows is nil and Groups non-nil) from an ungrouped one, which repeated fields alone cannot carry across the wire.
func (*View) Descriptor
deprecated
func (*View) GetAggregates ¶
func (*View) GetGrouped ¶
func (*View) ProtoMessage ¶
func (*View) ProtoMessage()
func (*View) ProtoReflect ¶
func (x *View) ProtoReflect() protoreflect.Message