Documentation
¶
Index ¶
- Constants
- Variables
- func LocalRecordError() *uint32
- func NoRecordError() *uint32
- func RegisterSyncServer(s grpc.ServiceRegistrar, srv SyncServer)
- type AcknowledgeResponse
- type Data
- func (d *Data) Describe() string
- func (*Data) Descriptor() ([]byte, []int)deprecated
- func (x *Data) GetBools() []bool
- func (x *Data) GetBytes() [][]byte
- func (x *Data) GetFloats() []float64
- func (x *Data) GetInts() []int64
- func (x *Data) GetIsList() bool
- func (x *Data) GetRecords() []*Record
- func (x *Data) GetStrings() []string
- func (x *Data) GetType() DataType
- func (x *Data) GetUints() []uint64
- func (*Data) ProtoMessage()
- func (x *Data) ProtoReflect() protoreflect.Message
- func (x *Data) Reset()
- func (x *Data) String() string
- type DataType
- type Error
- type IDataType
- type Info
- type IntData
- func (IntData) Append(value interface{}, data *Data) error
- func (IntData) Decode(data *Data, value interface{}) error
- func (IntData) Encode(value interface{}, data *Data) (err error)
- func (s IntData) From(i int64) *Data
- func (s IntData) FromAll(i ...int64) *Data
- func (s IntData) MustAppend(value interface{}, data *Data)
- func (s IntData) MustDecode(data *Data, value interface{})
- func (s IntData) MustEncode(value interface{}, data *Data)
- func (IntData) New() *Data
- func (s IntData) NewList() *Data
- func (IntData) NewValue() interface{}
- func (IntData) Type() DataType
- type Metadata
- type PullRequest
- type Record
- type RecordStatus
- func (*RecordStatus) Descriptor() ([]byte, []int)deprecated
- func (x *RecordStatus) GetError() uint32
- func (x *RecordStatus) GetErrorField() string
- func (x *RecordStatus) GetId() string
- func (x *RecordStatus) GetSequences() map[string]uint64
- func (x *RecordStatus) GetVersion() string
- func (*RecordStatus) ProtoMessage()
- func (x *RecordStatus) ProtoReflect() protoreflect.Message
- func (x *RecordStatus) Reset()
- func (x *RecordStatus) String() string
- type StringData
- func (StringData) Append(value interface{}, data *Data) error
- func (StringData) Decode(data *Data, value interface{}) error
- func (StringData) Encode(value interface{}, data *Data) (err error)
- func (s StringData) From(str string) *Data
- func (s StringData) FromAll(str ...string) *Data
- func (s StringData) MustAppend(value interface{}, data *Data)
- func (s StringData) MustDecode(data *Data, value interface{})
- func (s StringData) MustEncode(value interface{}, data *Data)
- func (StringData) New() *Data
- func (s StringData) NewList() *Data
- func (StringData) NewValue() interface{}
- func (StringData) Type() DataType
- type SyncClient
- type SyncServer
- type Sync_AcknowledgeClient
- type Sync_AcknowledgeServer
- type Sync_PullClient
- type Sync_PullServer
- type Sync_PushClient
- type Sync_PushServer
- type UintData
- func (UintData) Append(value interface{}, data *Data) error
- func (UintData) Decode(data *Data, value interface{}) error
- func (UintData) Encode(value interface{}, data *Data) (err error)
- func (s UintData) From(i uint64) *Data
- func (s UintData) FromAll(i ...uint64) *Data
- func (s UintData) MustAppend(value interface{}, data *Data)
- func (s UintData) MustDecode(data *Data, value interface{})
- func (s UintData) MustEncode(value interface{}, data *Data)
- func (UintData) New() *Data
- func (s UintData) NewList() *Data
- func (UintData) NewValue() interface{}
- func (UintData) Type() DataType
- type UnimplementedSyncServer
- type UnsafeSyncServer
Constants ¶
const API_VERSION uint32 = 1
Variables ¶
var ( Error_name = map[int32]string{ 0: "SERVER_ERROR", 1: "MALFORMED_RECORD", } Error_value = map[string]int32{ "SERVER_ERROR": 0, "MALFORMED_RECORD": 1, } )
Enum value maps for Error.
var ( DataType_name = map[int32]string{ 0: "UINT", 1: "INT", 2: "FLOAT", 3: "BOOL", 4: "STRING", 5: "BYTES", 16: "RECORD", } DataType_value = map[string]int32{ "UINT": 0, "INT": 1, "FLOAT": 2, "BOOL": 3, "STRING": 4, "BYTES": 5, "RECORD": 16, } )
Enum value maps for DataType.
var File_api_syncd_proto protoreflect.FileDescriptor
var Sync_ServiceDesc = grpc.ServiceDesc{ ServiceName: "syncd.Sync", HandlerType: (*SyncServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Check", Handler: _Sync_Check_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Push", Handler: _Sync_Push_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "Pull", Handler: _Sync_Pull_Handler, ServerStreams: true, }, { StreamName: "Acknowledge", Handler: _Sync_Acknowledge_Handler, ClientStreams: true, }, }, Metadata: "api/syncd.proto", }
Sync_ServiceDesc is the grpc.ServiceDesc for Sync service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func LocalRecordError ¶
func LocalRecordError() *uint32
func NoRecordError ¶
func NoRecordError() *uint32
func RegisterSyncServer ¶
func RegisterSyncServer(s grpc.ServiceRegistrar, srv SyncServer)
Types ¶
type AcknowledgeResponse ¶
type AcknowledgeResponse struct {
// contains filtered or unexported fields
}
func (*AcknowledgeResponse) Descriptor
deprecated
func (*AcknowledgeResponse) Descriptor() ([]byte, []int)
Deprecated: Use AcknowledgeResponse.ProtoReflect.Descriptor instead.
func (*AcknowledgeResponse) ProtoMessage ¶
func (*AcknowledgeResponse) ProtoMessage()
func (*AcknowledgeResponse) ProtoReflect ¶
func (x *AcknowledgeResponse) ProtoReflect() protoreflect.Message
func (*AcknowledgeResponse) Reset ¶
func (x *AcknowledgeResponse) Reset()
func (*AcknowledgeResponse) String ¶
func (x *AcknowledgeResponse) String() string
type Data ¶
type Data struct {
Type DataType `protobuf:"varint,1,opt,name=type,proto3,enum=syncd.DataType" json:"type,omitempty"`
IsList bool `protobuf:"varint,2,opt,name=is_list,json=isList,proto3" json:"is_list,omitempty"`
Uints []uint64 `protobuf:"varint,3,rep,packed,name=uints,proto3" json:"uints,omitempty"`
Ints []int64 `protobuf:"zigzag64,4,rep,packed,name=ints,proto3" json:"ints,omitempty"`
Floats []float64 `protobuf:"fixed64,5,rep,packed,name=floats,proto3" json:"floats,omitempty"`
Bools []bool `protobuf:"varint,6,rep,packed,name=bools,proto3" json:"bools,omitempty"`
Strings []string `protobuf:"bytes,7,rep,name=strings,proto3" json:"strings,omitempty"`
Bytes [][]byte `protobuf:"bytes,8,rep,name=bytes,proto3" json:"bytes,omitempty"`
Records []*Record `protobuf:"bytes,15,rep,name=records,proto3" json:"records,omitempty"`
// contains filtered or unexported fields
}
func (*Data) Descriptor
deprecated
func (*Data) GetRecords ¶
func (*Data) GetStrings ¶
func (*Data) ProtoMessage ¶
func (*Data) ProtoMessage()
func (*Data) ProtoReflect ¶
func (x *Data) ProtoReflect() protoreflect.Message
type DataType ¶
type DataType int32
const ( DataType_UINT DataType = 0 // encoded as uint64 DataType_INT DataType = 1 // encoded as sint64 DataType_FLOAT DataType = 2 // encoded as double DataType_BOOL DataType = 3 // encoded as bool DataType_STRING DataType = 4 // encoded as string DataType_BYTES DataType = 5 // encoded as bytes DataType_RECORD DataType = 16 )
func (DataType) Descriptor ¶
func (DataType) Descriptor() protoreflect.EnumDescriptor
func (DataType) EnumDescriptor
deprecated
func (DataType) Number ¶
func (x DataType) Number() protoreflect.EnumNumber
func (DataType) Type ¶
func (DataType) Type() protoreflect.EnumType
type Error ¶
type Error int32
func (Error) Descriptor ¶
func (Error) Descriptor() protoreflect.EnumDescriptor
func (Error) EnumDescriptor
deprecated
func (Error) Number ¶
func (x Error) Number() protoreflect.EnumNumber
func (Error) Type ¶
func (Error) Type() protoreflect.EnumType
type IDataType ¶
type IDataType interface {
New() *Data
NewList() *Data
NewValue() interface{}
Type() DataType
Append(value interface{}, data *Data) error
MustAppend(value interface{}, data *Data)
Encode(value interface{}, data *Data) error
MustEncode(value interface{}, data *Data)
Decode(data *Data, value interface{}) error
MustDecode(data *Data, value interface{})
}
type Info ¶
type Info struct {
ApiVersion uint32 `protobuf:"varint,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
// contains filtered or unexported fields
}
func (*Info) Descriptor
deprecated
func (*Info) GetApiVersion ¶
func (*Info) ProtoMessage ¶
func (*Info) ProtoMessage()
func (*Info) ProtoReflect ¶
func (x *Info) ProtoReflect() protoreflect.Message
type IntData ¶
type IntData struct{}
func (IntData) MustAppend ¶
func (IntData) MustDecode ¶
func (IntData) MustEncode ¶
type Metadata ¶
func GetMetadataFromContext ¶
func (*Metadata) MetricLabels ¶
func (md *Metadata) MetricLabels() prometheus.Labels
type PullRequest ¶
type PullRequest struct {
// contains filtered or unexported fields
}
func (*PullRequest) Descriptor
deprecated
func (*PullRequest) Descriptor() ([]byte, []int)
Deprecated: Use PullRequest.ProtoReflect.Descriptor instead.
func (*PullRequest) ProtoMessage ¶
func (*PullRequest) ProtoMessage()
func (*PullRequest) ProtoReflect ¶
func (x *PullRequest) ProtoReflect() protoreflect.Message
func (*PullRequest) Reset ¶
func (x *PullRequest) Reset()
func (*PullRequest) String ¶
func (x *PullRequest) String() string
type Record ¶
type Record struct {
Fields map[string]*Data `` /* 153-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*Record) Descriptor
deprecated
func (*Record) ProtoMessage ¶
func (*Record) ProtoMessage()
func (*Record) ProtoReflect ¶
func (x *Record) ProtoReflect() protoreflect.Message
type RecordStatus ¶
type RecordStatus struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
Error *uint32 `protobuf:"varint,3,opt,name=error,proto3,oneof" json:"error,omitempty"`
ErrorField *string `protobuf:"bytes,4,opt,name=error_field,json=errorField,proto3,oneof" json:"error_field,omitempty"`
Sequences map[string]uint64 `` /* 160-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*RecordStatus) Descriptor
deprecated
func (*RecordStatus) Descriptor() ([]byte, []int)
Deprecated: Use RecordStatus.ProtoReflect.Descriptor instead.
func (*RecordStatus) GetError ¶
func (x *RecordStatus) GetError() uint32
func (*RecordStatus) GetErrorField ¶
func (x *RecordStatus) GetErrorField() string
func (*RecordStatus) GetId ¶
func (x *RecordStatus) GetId() string
func (*RecordStatus) GetSequences ¶
func (x *RecordStatus) GetSequences() map[string]uint64
func (*RecordStatus) GetVersion ¶
func (x *RecordStatus) GetVersion() string
func (*RecordStatus) ProtoMessage ¶
func (*RecordStatus) ProtoMessage()
func (*RecordStatus) ProtoReflect ¶
func (x *RecordStatus) ProtoReflect() protoreflect.Message
func (*RecordStatus) Reset ¶
func (x *RecordStatus) Reset()
func (*RecordStatus) String ¶
func (x *RecordStatus) String() string
type StringData ¶
type StringData struct{}
func (StringData) Append ¶
func (StringData) Append(value interface{}, data *Data) error
func (StringData) Decode ¶
func (StringData) Decode(data *Data, value interface{}) error
func (StringData) Encode ¶
func (StringData) Encode(value interface{}, data *Data) (err error)
func (StringData) From ¶
func (s StringData) From(str string) *Data
func (StringData) FromAll ¶
func (s StringData) FromAll(str ...string) *Data
func (StringData) MustAppend ¶
func (s StringData) MustAppend(value interface{}, data *Data)
func (StringData) MustDecode ¶
func (s StringData) MustDecode(data *Data, value interface{})
func (StringData) MustEncode ¶
func (s StringData) MustEncode(value interface{}, data *Data)
func (StringData) New ¶
func (StringData) New() *Data
func (StringData) NewList ¶
func (s StringData) NewList() *Data
func (StringData) NewValue ¶
func (StringData) NewValue() interface{}
func (StringData) Type ¶
func (StringData) Type() DataType
type SyncClient ¶
type SyncClient interface {
Check(ctx context.Context, in *Info, opts ...grpc.CallOption) (*Info, error)
Push(ctx context.Context, opts ...grpc.CallOption) (Sync_PushClient, error)
Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (Sync_PullClient, error)
Acknowledge(ctx context.Context, opts ...grpc.CallOption) (Sync_AcknowledgeClient, error)
}
SyncClient is the client API for Sync 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 NewSyncClient ¶
func NewSyncClient(cc grpc.ClientConnInterface) SyncClient
type SyncServer ¶
type SyncServer interface {
Check(context.Context, *Info) (*Info, error)
Push(Sync_PushServer) error
Pull(*PullRequest, Sync_PullServer) error
Acknowledge(Sync_AcknowledgeServer) error
// contains filtered or unexported methods
}
SyncServer is the server API for Sync service. All implementations must embed UnimplementedSyncServer for forward compatibility
type Sync_AcknowledgeClient ¶
type Sync_AcknowledgeClient interface {
Send(*RecordStatus) error
CloseAndRecv() (*AcknowledgeResponse, error)
grpc.ClientStream
}
type Sync_AcknowledgeServer ¶
type Sync_AcknowledgeServer interface {
SendAndClose(*AcknowledgeResponse) error
Recv() (*RecordStatus, error)
grpc.ServerStream
}
type Sync_PullClient ¶
type Sync_PullClient interface {
Recv() (*Record, error)
grpc.ClientStream
}
type Sync_PullServer ¶
type Sync_PullServer interface {
Send(*Record) error
grpc.ServerStream
}
type Sync_PushClient ¶
type Sync_PushClient interface {
Send(*Record) error
Recv() (*RecordStatus, error)
grpc.ClientStream
}
type Sync_PushServer ¶
type Sync_PushServer interface {
Send(*RecordStatus) error
Recv() (*Record, error)
grpc.ServerStream
}
type UintData ¶
type UintData struct{}
func (UintData) MustAppend ¶
func (UintData) MustDecode ¶
func (UintData) MustEncode ¶
type UnimplementedSyncServer ¶
type UnimplementedSyncServer struct {
}
UnimplementedSyncServer must be embedded to have forward compatible implementations.
func (UnimplementedSyncServer) Acknowledge ¶
func (UnimplementedSyncServer) Acknowledge(Sync_AcknowledgeServer) error
func (UnimplementedSyncServer) Pull ¶
func (UnimplementedSyncServer) Pull(*PullRequest, Sync_PullServer) error
func (UnimplementedSyncServer) Push ¶
func (UnimplementedSyncServer) Push(Sync_PushServer) error
type UnsafeSyncServer ¶
type UnsafeSyncServer interface {
// contains filtered or unexported methods
}
UnsafeSyncServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SyncServer will result in compilation errors.