Documentation
¶
Overview ¶
Package databroker contains databroker protobuf definitions.
Index ¶
- Variables
- func Get(ctx context.Context, client DataBrokerServiceClient, object recordObject) error
- func GetViaJSON[T any](ctx context.Context, client DataBrokerServiceClient, ...) (*T, error)
- func IsNotFound(err error) bool
- func PutMulti(ctx context.Context, client DataBrokerServiceClient, records ...*Record) error
- func RegisterDataBrokerServiceServer(s *grpc.Server, srv DataBrokerServiceServer)
- type AcquireLeaseRequest
- func (*AcquireLeaseRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AcquireLeaseRequest) GetDuration() *durationpb.Duration
- func (x *AcquireLeaseRequest) GetName() string
- func (*AcquireLeaseRequest) ProtoMessage()
- func (x *AcquireLeaseRequest) ProtoReflect() protoreflect.Message
- func (x *AcquireLeaseRequest) Reset()
- func (x *AcquireLeaseRequest) String() string
- type AcquireLeaseResponse
- func (*AcquireLeaseResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AcquireLeaseResponse) GetId() string
- func (*AcquireLeaseResponse) ProtoMessage()
- func (x *AcquireLeaseResponse) ProtoReflect() protoreflect.Message
- func (x *AcquireLeaseResponse) Reset()
- func (x *AcquireLeaseResponse) String() string
- type DataBrokerServiceClient
- type DataBrokerServiceServer
- type DataBrokerService_SyncClient
- type DataBrokerService_SyncLatestClient
- type DataBrokerService_SyncLatestServer
- type DataBrokerService_SyncServer
- type GetRequest
- type GetResponse
- type Leaser
- type LeaserHandler
- type ListTypesResponse
- type Options
- type PatchRequest
- func (*PatchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PatchRequest) GetFieldMask() *fieldmaskpb.FieldMask
- func (x *PatchRequest) GetRecords() []*Record
- func (*PatchRequest) ProtoMessage()
- func (x *PatchRequest) ProtoReflect() protoreflect.Message
- func (x *PatchRequest) Reset()
- func (x *PatchRequest) String() string
- type PatchResponse
- func (*PatchResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PatchResponse) GetRecord() *Record
- func (x *PatchResponse) GetRecords() []*Record
- func (x *PatchResponse) GetServerVersion() uint64
- func (*PatchResponse) ProtoMessage()
- func (x *PatchResponse) ProtoReflect() protoreflect.Message
- func (x *PatchResponse) Reset()
- func (x *PatchResponse) String() string
- type PutRequest
- type PutResponse
- func (*PutResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PutResponse) GetRecord() *Record
- func (x *PutResponse) GetRecords() []*Record
- func (x *PutResponse) GetServerVersion() uint64
- func (*PutResponse) ProtoMessage()
- func (x *PutResponse) ProtoReflect() protoreflect.Message
- func (x *PutResponse) Reset()
- func (x *PutResponse) String() string
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRequest) GetFilter() *structpb.Struct
- func (x *QueryRequest) GetLimit() int64
- func (x *QueryRequest) GetOffset() int64
- func (x *QueryRequest) GetQuery() string
- func (x *QueryRequest) GetType() string
- func (*QueryRequest) ProtoMessage()
- func (x *QueryRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRequest) Reset()
- func (x *QueryRequest) SetFilterByID(id string)
- func (x *QueryRequest) SetFilterByIDOrIndex(idOrIndex string)
- func (x *QueryRequest) String() string
- type QueryResponse
- func (*QueryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryResponse) GetRecordVersion() uint64
- func (x *QueryResponse) GetRecords() []*Record
- func (x *QueryResponse) GetServerVersion() uint64
- func (x *QueryResponse) GetTotalCount() int64
- func (*QueryResponse) ProtoMessage()
- func (x *QueryResponse) ProtoReflect() protoreflect.Message
- func (x *QueryResponse) Reset()
- func (x *QueryResponse) String() string
- type Reconciler
- type ReconcilerOption
- type Record
- func ApplyOffsetAndLimit(all []*Record, offset, limit int) (records []*Record, totalCount int)
- func GetChangeSet(current, target RecordSetBundle, cmpFn RecordCompareFn) []*Record
- func InitialSync(ctx context.Context, client DataBrokerServiceClient, req *SyncLatestRequest) (records []*Record, recordVersion, serverVersion uint64, err error)
- func NewRecord(object recordObject) *Record
- func (*Record) Descriptor() ([]byte, []int)deprecated
- func (x *Record) GetData() *anypb.Any
- func (x *Record) GetDeletedAt() *timestamppb.Timestamp
- func (x *Record) GetId() string
- func (x *Record) GetModifiedAt() *timestamppb.Timestamp
- func (x *Record) GetType() string
- func (x *Record) GetVersion() uint64
- func (r *Record) MarshalJSON() ([]byte, error)
- func (*Record) ProtoMessage()
- func (x *Record) ProtoReflect() protoreflect.Message
- func (x *Record) Reset()
- func (x *Record) String() string
- func (r *Record) UnmarshalJSON(data []byte) error
- type RecordCompareFn
- type RecordSet
- type RecordSetBundle
- func (rsb RecordSetBundle) Add(record *Record)
- func (rsb RecordSetBundle) Flatten() []*Record
- func (rsb RecordSetBundle) Get(typeName, id string) (record *Record, ok bool)
- func (rsb RecordSetBundle) GetAdded(other RecordSetBundle) RecordSetBundle
- func (rsb RecordSetBundle) GetModified(other RecordSetBundle, cmpFn RecordCompareFn) RecordSetBundle
- func (rsb RecordSetBundle) GetRemoved(other RecordSetBundle) RecordSetBundle
- func (rsb RecordSetBundle) RecordTypes() []string
- type ReleaseLeaseRequest
- func (*ReleaseLeaseRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReleaseLeaseRequest) GetId() string
- func (x *ReleaseLeaseRequest) GetName() string
- func (*ReleaseLeaseRequest) ProtoMessage()
- func (x *ReleaseLeaseRequest) ProtoReflect() protoreflect.Message
- func (x *ReleaseLeaseRequest) Reset()
- func (x *ReleaseLeaseRequest) String() string
- type RenewLeaseRequest
- func (*RenewLeaseRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RenewLeaseRequest) GetDuration() *durationpb.Duration
- func (x *RenewLeaseRequest) GetId() string
- func (x *RenewLeaseRequest) GetName() string
- func (*RenewLeaseRequest) ProtoMessage()
- func (x *RenewLeaseRequest) ProtoReflect() protoreflect.Message
- func (x *RenewLeaseRequest) Reset()
- func (x *RenewLeaseRequest) String() string
- type SetOptionsRequest
- func (*SetOptionsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetOptionsRequest) GetOptions() *Options
- func (x *SetOptionsRequest) GetType() string
- func (*SetOptionsRequest) ProtoMessage()
- func (x *SetOptionsRequest) ProtoReflect() protoreflect.Message
- func (x *SetOptionsRequest) Reset()
- func (x *SetOptionsRequest) String() string
- type SetOptionsResponse
- func (*SetOptionsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SetOptionsResponse) GetOptions() *Options
- func (*SetOptionsResponse) ProtoMessage()
- func (x *SetOptionsResponse) ProtoReflect() protoreflect.Message
- func (x *SetOptionsResponse) Reset()
- func (x *SetOptionsResponse) String() string
- type StateBuilderFn
- type SyncLatestRequest
- type SyncLatestResponse
- func (*SyncLatestResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SyncLatestResponse) GetRecord() *Record
- func (m *SyncLatestResponse) GetResponse() isSyncLatestResponse_Response
- func (x *SyncLatestResponse) GetVersions() *Versions
- func (*SyncLatestResponse) ProtoMessage()
- func (x *SyncLatestResponse) ProtoReflect() protoreflect.Message
- func (x *SyncLatestResponse) Reset()
- func (x *SyncLatestResponse) String() string
- type SyncLatestResponse_Record
- type SyncLatestResponse_Versions
- type SyncRequest
- func (*SyncRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SyncRequest) GetRecordVersion() uint64
- func (x *SyncRequest) GetServerVersion() uint64
- func (x *SyncRequest) GetType() string
- func (*SyncRequest) ProtoMessage()
- func (x *SyncRequest) ProtoReflect() protoreflect.Message
- func (x *SyncRequest) Reset()
- func (x *SyncRequest) String() string
- type SyncResponse
- type Syncer
- type SyncerHandler
- type SyncerOption
- type UnimplementedDataBrokerServiceServer
- func (*UnimplementedDataBrokerServiceServer) AcquireLease(context.Context, *AcquireLeaseRequest) (*AcquireLeaseResponse, error)
- func (*UnimplementedDataBrokerServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
- func (*UnimplementedDataBrokerServiceServer) ListTypes(context.Context, *emptypb.Empty) (*ListTypesResponse, error)
- func (*UnimplementedDataBrokerServiceServer) Patch(context.Context, *PatchRequest) (*PatchResponse, error)
- func (*UnimplementedDataBrokerServiceServer) Put(context.Context, *PutRequest) (*PutResponse, error)
- func (*UnimplementedDataBrokerServiceServer) Query(context.Context, *QueryRequest) (*QueryResponse, error)
- func (*UnimplementedDataBrokerServiceServer) ReleaseLease(context.Context, *ReleaseLeaseRequest) (*emptypb.Empty, error)
- func (*UnimplementedDataBrokerServiceServer) RenewLease(context.Context, *RenewLeaseRequest) (*emptypb.Empty, error)
- func (*UnimplementedDataBrokerServiceServer) SetOptions(context.Context, *SetOptionsRequest) (*SetOptionsResponse, error)
- func (*UnimplementedDataBrokerServiceServer) Sync(*SyncRequest, DataBrokerService_SyncServer) error
- func (*UnimplementedDataBrokerServiceServer) SyncLatest(*SyncLatestRequest, DataBrokerService_SyncLatestServer) error
- type Versions
- func (*Versions) Descriptor() ([]byte, []int)deprecated
- func (x *Versions) GetLatestRecordVersion() uint64
- func (x *Versions) GetServerVersion() uint64
- func (*Versions) ProtoMessage()
- func (x *Versions) ProtoReflect() protoreflect.Message
- func (x *Versions) Reset()
- func (x *Versions) String() string
Constants ¶
This section is empty.
Variables ¶
var File_databroker_proto protoreflect.FileDescriptor
Functions ¶
func Get ¶ added in v0.17.0
func Get(ctx context.Context, client DataBrokerServiceClient, object recordObject) error
Get gets a record from the databroker and unmarshals it into the object.
func GetViaJSON ¶ added in v0.20.0
func GetViaJSON[T any](ctx context.Context, client DataBrokerServiceClient, recordType, recordID string) (*T, error)
GetViaJSON gets a record from the databroker, marshals it to JSON, and then unmarshals it to the given type.
func IsNotFound ¶ added in v0.25.0
IsNotFound returns true if the error is a not found error.
func PutMulti ¶ added in v0.24.0
func PutMulti(ctx context.Context, client DataBrokerServiceClient, records ...*Record) error
PutMulti puts the records into the databroker in batches.
func RegisterDataBrokerServiceServer ¶
func RegisterDataBrokerServiceServer(s *grpc.Server, srv DataBrokerServiceServer)
Types ¶
type AcquireLeaseRequest ¶ added in v0.15.0
type AcquireLeaseRequest struct { // Name is the name of the lease. Only a single client can hold the lease on // the specified name at any one time. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Duration is the duration of the lease. After the duration is reached the // lease can be acquired by other clients. Duration *durationpb.Duration `protobuf:"bytes,2,opt,name=duration,proto3" json:"duration,omitempty"` // contains filtered or unexported fields }
func (*AcquireLeaseRequest) Descriptor
deprecated
added in
v0.15.0
func (*AcquireLeaseRequest) Descriptor() ([]byte, []int)
Deprecated: Use AcquireLeaseRequest.ProtoReflect.Descriptor instead.
func (*AcquireLeaseRequest) GetDuration ¶ added in v0.15.0
func (x *AcquireLeaseRequest) GetDuration() *durationpb.Duration
func (*AcquireLeaseRequest) GetName ¶ added in v0.15.0
func (x *AcquireLeaseRequest) GetName() string
func (*AcquireLeaseRequest) ProtoMessage ¶ added in v0.15.0
func (*AcquireLeaseRequest) ProtoMessage()
func (*AcquireLeaseRequest) ProtoReflect ¶ added in v0.15.0
func (x *AcquireLeaseRequest) ProtoReflect() protoreflect.Message
func (*AcquireLeaseRequest) Reset ¶ added in v0.15.0
func (x *AcquireLeaseRequest) Reset()
func (*AcquireLeaseRequest) String ¶ added in v0.15.0
func (x *AcquireLeaseRequest) String() string
type AcquireLeaseResponse ¶ added in v0.15.0
type AcquireLeaseResponse struct { // Id is the id of the acquired lease. Subsequent calls to release or renew // will need both the lease name and the lease id. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*AcquireLeaseResponse) Descriptor
deprecated
added in
v0.15.0
func (*AcquireLeaseResponse) Descriptor() ([]byte, []int)
Deprecated: Use AcquireLeaseResponse.ProtoReflect.Descriptor instead.
func (*AcquireLeaseResponse) GetId ¶ added in v0.15.0
func (x *AcquireLeaseResponse) GetId() string
func (*AcquireLeaseResponse) ProtoMessage ¶ added in v0.15.0
func (*AcquireLeaseResponse) ProtoMessage()
func (*AcquireLeaseResponse) ProtoReflect ¶ added in v0.15.0
func (x *AcquireLeaseResponse) ProtoReflect() protoreflect.Message
func (*AcquireLeaseResponse) Reset ¶ added in v0.15.0
func (x *AcquireLeaseResponse) Reset()
func (*AcquireLeaseResponse) String ¶ added in v0.15.0
func (x *AcquireLeaseResponse) String() string
type DataBrokerServiceClient ¶
type DataBrokerServiceClient interface { // AcquireLease acquires a distributed mutex lease. AcquireLease(ctx context.Context, in *AcquireLeaseRequest, opts ...grpc.CallOption) (*AcquireLeaseResponse, error) // Get gets a record. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) // ListTypes lists all the known record types. ListTypes(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListTypesResponse, error) // Put saves a record. Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // Patch updates specific fields of an existing record. Patch(ctx context.Context, in *PatchRequest, opts ...grpc.CallOption) (*PatchResponse, error) // Query queries for records. Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) // ReleaseLease releases a distributed mutex lease. ReleaseLease(ctx context.Context, in *ReleaseLeaseRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // RenewLease renews a distributed mutex lease. RenewLease(ctx context.Context, in *RenewLeaseRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // SetOptions sets the options for a type in the databroker. SetOptions(ctx context.Context, in *SetOptionsRequest, opts ...grpc.CallOption) (*SetOptionsResponse, error) // Sync streams changes to records after the specified version. Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (DataBrokerService_SyncClient, error) // SyncLatest streams the latest version of every record. SyncLatest(ctx context.Context, in *SyncLatestRequest, opts ...grpc.CallOption) (DataBrokerService_SyncLatestClient, error) }
DataBrokerServiceClient is the client API for DataBrokerService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewDataBrokerServiceClient ¶
func NewDataBrokerServiceClient(cc grpc.ClientConnInterface) DataBrokerServiceClient
type DataBrokerServiceServer ¶
type DataBrokerServiceServer interface { // AcquireLease acquires a distributed mutex lease. AcquireLease(context.Context, *AcquireLeaseRequest) (*AcquireLeaseResponse, error) // Get gets a record. Get(context.Context, *GetRequest) (*GetResponse, error) // ListTypes lists all the known record types. ListTypes(context.Context, *emptypb.Empty) (*ListTypesResponse, error) // Put saves a record. Put(context.Context, *PutRequest) (*PutResponse, error) // Patch updates specific fields of an existing record. Patch(context.Context, *PatchRequest) (*PatchResponse, error) // Query queries for records. Query(context.Context, *QueryRequest) (*QueryResponse, error) // ReleaseLease releases a distributed mutex lease. ReleaseLease(context.Context, *ReleaseLeaseRequest) (*emptypb.Empty, error) // RenewLease renews a distributed mutex lease. RenewLease(context.Context, *RenewLeaseRequest) (*emptypb.Empty, error) // SetOptions sets the options for a type in the databroker. SetOptions(context.Context, *SetOptionsRequest) (*SetOptionsResponse, error) // Sync streams changes to records after the specified version. Sync(*SyncRequest, DataBrokerService_SyncServer) error // SyncLatest streams the latest version of every record. SyncLatest(*SyncLatestRequest, DataBrokerService_SyncLatestServer) error }
DataBrokerServiceServer is the server API for DataBrokerService service.
type DataBrokerService_SyncClient ¶
type DataBrokerService_SyncClient interface { Recv() (*SyncResponse, error) grpc.ClientStream }
type DataBrokerService_SyncLatestClient ¶ added in v0.14.0
type DataBrokerService_SyncLatestClient interface { Recv() (*SyncLatestResponse, error) grpc.ClientStream }
type DataBrokerService_SyncLatestServer ¶ added in v0.14.0
type DataBrokerService_SyncLatestServer interface { Send(*SyncLatestResponse) error grpc.ServerStream }
type DataBrokerService_SyncServer ¶
type DataBrokerService_SyncServer interface { Send(*SyncResponse) error grpc.ServerStream }
type GetRequest ¶
type GetRequest struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetId ¶
func (x *GetRequest) GetId() string
func (*GetRequest) GetType ¶
func (x *GetRequest) GetType() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type GetResponse ¶
type GetResponse struct { Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetRecord ¶
func (x *GetResponse) GetRecord() *Record
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
type Leaser ¶ added in v0.15.0
type Leaser struct {
// contains filtered or unexported fields
}
A Leaser attempts to acquire a lease and if successful runs the handler. If the lease is released the context used for the handler will be canceled and a new lease acquisition will be attempted.
func NewLeaser ¶ added in v0.15.0
func NewLeaser(leaseName string, ttl time.Duration, handler LeaserHandler) *Leaser
NewLeaser creates a new Leaser.
func NewLeasers ¶ added in v0.17.3
func NewLeasers(leaseName string, ttl time.Duration, client DataBrokerServiceClient, handlers ...func(context.Context) error) *Leaser
NewLeasers creates a leaser using multiple handler functions
type LeaserHandler ¶ added in v0.15.0
type LeaserHandler interface { GetDataBrokerServiceClient() DataBrokerServiceClient RunLeased(ctx context.Context) error }
A LeaserHandler is a handler for the locker.
type ListTypesResponse ¶ added in v0.22.0
type ListTypesResponse struct { Types []string `protobuf:"bytes,1,rep,name=types,proto3" json:"types,omitempty"` // contains filtered or unexported fields }
func (*ListTypesResponse) Descriptor
deprecated
added in
v0.22.0
func (*ListTypesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListTypesResponse.ProtoReflect.Descriptor instead.
func (*ListTypesResponse) GetTypes ¶ added in v0.22.0
func (x *ListTypesResponse) GetTypes() []string
func (*ListTypesResponse) ProtoMessage ¶ added in v0.22.0
func (*ListTypesResponse) ProtoMessage()
func (*ListTypesResponse) ProtoReflect ¶ added in v0.22.0
func (x *ListTypesResponse) ProtoReflect() protoreflect.Message
func (*ListTypesResponse) Reset ¶ added in v0.22.0
func (x *ListTypesResponse) Reset()
func (*ListTypesResponse) String ¶ added in v0.22.0
func (x *ListTypesResponse) String() string
type Options ¶ added in v0.14.0
type Options struct { // capacity sets a maximum size for the given type. Once the capacity is // reached the oldest records will be removed. Capacity *uint64 `protobuf:"varint,1,opt,name=capacity,proto3,oneof" json:"capacity,omitempty"` // contains filtered or unexported fields }
Options are the options for a type stored in the databroker.
func (*Options) Descriptor
deprecated
added in
v0.14.0
func (*Options) GetCapacity ¶ added in v0.14.0
func (*Options) ProtoMessage ¶ added in v0.14.0
func (*Options) ProtoMessage()
func (*Options) ProtoReflect ¶ added in v0.14.0
func (x *Options) ProtoReflect() protoreflect.Message
type PatchRequest ¶ added in v0.24.0
type PatchRequest struct { Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` // contains filtered or unexported fields }
func (*PatchRequest) Descriptor
deprecated
added in
v0.24.0
func (*PatchRequest) Descriptor() ([]byte, []int)
Deprecated: Use PatchRequest.ProtoReflect.Descriptor instead.
func (*PatchRequest) GetFieldMask ¶ added in v0.24.0
func (x *PatchRequest) GetFieldMask() *fieldmaskpb.FieldMask
func (*PatchRequest) GetRecords ¶ added in v0.24.0
func (x *PatchRequest) GetRecords() []*Record
func (*PatchRequest) ProtoMessage ¶ added in v0.24.0
func (*PatchRequest) ProtoMessage()
func (*PatchRequest) ProtoReflect ¶ added in v0.24.0
func (x *PatchRequest) ProtoReflect() protoreflect.Message
func (*PatchRequest) Reset ¶ added in v0.24.0
func (x *PatchRequest) Reset()
func (*PatchRequest) String ¶ added in v0.24.0
func (x *PatchRequest) String() string
type PatchResponse ¶ added in v0.24.0
type PatchResponse struct { ServerVersion uint64 `protobuf:"varint,1,opt,name=server_version,json=serverVersion,proto3" json:"server_version,omitempty"` Records []*Record `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"` // contains filtered or unexported fields }
func (*PatchResponse) Descriptor
deprecated
added in
v0.24.0
func (*PatchResponse) Descriptor() ([]byte, []int)
Deprecated: Use PatchResponse.ProtoReflect.Descriptor instead.
func (*PatchResponse) GetRecord ¶ added in v0.24.0
func (x *PatchResponse) GetRecord() *Record
GetRecord gets the first record, or nil if there are none.
func (*PatchResponse) GetRecords ¶ added in v0.24.0
func (x *PatchResponse) GetRecords() []*Record
func (*PatchResponse) GetServerVersion ¶ added in v0.24.0
func (x *PatchResponse) GetServerVersion() uint64
func (*PatchResponse) ProtoMessage ¶ added in v0.24.0
func (*PatchResponse) ProtoMessage()
func (*PatchResponse) ProtoReflect ¶ added in v0.24.0
func (x *PatchResponse) ProtoReflect() protoreflect.Message
func (*PatchResponse) Reset ¶ added in v0.24.0
func (x *PatchResponse) Reset()
func (*PatchResponse) String ¶ added in v0.24.0
func (x *PatchResponse) String() string
type PutRequest ¶ added in v0.14.0
type PutRequest struct { Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` // contains filtered or unexported fields }
func OptimumPutRequestsFromRecords ¶ added in v0.17.3
func OptimumPutRequestsFromRecords(records []*Record) []*PutRequest
OptimumPutRequestsFromRecords creates one or more PutRequests from a slice of records. If the size of the request exceeds the max message size it will be split in half recursively until the requests are less than or equal to the max message size.
func (*PutRequest) Descriptor
deprecated
added in
v0.14.0
func (*PutRequest) Descriptor() ([]byte, []int)
Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.
func (*PutRequest) GetRecord ¶ added in v0.14.0
func (x *PutRequest) GetRecord() *Record
GetRecord gets the first record, or nil if there are none.
func (*PutRequest) GetRecords ¶ added in v0.17.3
func (x *PutRequest) GetRecords() []*Record
func (*PutRequest) ProtoMessage ¶ added in v0.14.0
func (*PutRequest) ProtoMessage()
func (*PutRequest) ProtoReflect ¶ added in v0.14.0
func (x *PutRequest) ProtoReflect() protoreflect.Message
func (*PutRequest) Reset ¶ added in v0.14.0
func (x *PutRequest) Reset()
func (*PutRequest) String ¶ added in v0.14.0
func (x *PutRequest) String() string
type PutResponse ¶ added in v0.14.0
type PutResponse struct { ServerVersion uint64 `protobuf:"varint,1,opt,name=server_version,json=serverVersion,proto3" json:"server_version,omitempty"` Records []*Record `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"` // contains filtered or unexported fields }
func Put ¶ added in v0.17.0
func Put(ctx context.Context, client DataBrokerServiceClient, objects ...recordObject) (*PutResponse, error)
Put puts a record into the databroker.
func (*PutResponse) Descriptor
deprecated
added in
v0.14.0
func (*PutResponse) Descriptor() ([]byte, []int)
Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.
func (*PutResponse) GetRecord ¶ added in v0.14.0
func (x *PutResponse) GetRecord() *Record
GetRecord gets the first record, or nil if there are none.
func (*PutResponse) GetRecords ¶ added in v0.17.3
func (x *PutResponse) GetRecords() []*Record
func (*PutResponse) GetServerVersion ¶ added in v0.14.0
func (x *PutResponse) GetServerVersion() uint64
func (*PutResponse) ProtoMessage ¶ added in v0.14.0
func (*PutResponse) ProtoMessage()
func (*PutResponse) ProtoReflect ¶ added in v0.14.0
func (x *PutResponse) ProtoReflect() protoreflect.Message
func (*PutResponse) Reset ¶ added in v0.14.0
func (x *PutResponse) Reset()
func (*PutResponse) String ¶ added in v0.14.0
func (x *PutResponse) String() string
type QueryRequest ¶ added in v0.11.0
type QueryRequest struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` Limit int64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` Filter *structpb.Struct `protobuf:"bytes,5,opt,name=filter,proto3" json:"filter,omitempty"` // contains filtered or unexported fields }
func (*QueryRequest) Descriptor
deprecated
added in
v0.11.0
func (*QueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) GetFilter ¶ added in v0.18.0
func (x *QueryRequest) GetFilter() *structpb.Struct
func (*QueryRequest) GetLimit ¶ added in v0.11.0
func (x *QueryRequest) GetLimit() int64
func (*QueryRequest) GetOffset ¶ added in v0.11.0
func (x *QueryRequest) GetOffset() int64
func (*QueryRequest) GetQuery ¶ added in v0.11.0
func (x *QueryRequest) GetQuery() string
func (*QueryRequest) GetType ¶ added in v0.11.0
func (x *QueryRequest) GetType() string
func (*QueryRequest) ProtoMessage ¶ added in v0.11.0
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) ProtoReflect ¶ added in v0.11.0
func (x *QueryRequest) ProtoReflect() protoreflect.Message
func (*QueryRequest) Reset ¶ added in v0.11.0
func (x *QueryRequest) Reset()
func (*QueryRequest) SetFilterByID ¶ added in v0.18.0
func (x *QueryRequest) SetFilterByID(id string)
SetFilterByID sets the filter to an id.
func (*QueryRequest) SetFilterByIDOrIndex ¶ added in v0.18.0
func (x *QueryRequest) SetFilterByIDOrIndex(idOrIndex string)
SetFilterByIDOrIndex sets the filter to an id or an index.
func (*QueryRequest) String ¶ added in v0.11.0
func (x *QueryRequest) String() string
type QueryResponse ¶ added in v0.11.0
type QueryResponse struct { Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` TotalCount int64 `protobuf:"varint,2,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` ServerVersion uint64 `protobuf:"varint,3,opt,name=server_version,json=serverVersion,proto3" json:"server_version,omitempty"` RecordVersion uint64 `protobuf:"varint,4,opt,name=record_version,json=recordVersion,proto3" json:"record_version,omitempty"` // contains filtered or unexported fields }
func (*QueryResponse) Descriptor
deprecated
added in
v0.11.0
func (*QueryResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
func (*QueryResponse) GetRecordVersion ¶ added in v0.18.0
func (x *QueryResponse) GetRecordVersion() uint64
func (*QueryResponse) GetRecords ¶ added in v0.11.0
func (x *QueryResponse) GetRecords() []*Record
func (*QueryResponse) GetServerVersion ¶ added in v0.18.0
func (x *QueryResponse) GetServerVersion() uint64
func (*QueryResponse) GetTotalCount ¶ added in v0.11.0
func (x *QueryResponse) GetTotalCount() int64
func (*QueryResponse) ProtoMessage ¶ added in v0.11.0
func (*QueryResponse) ProtoMessage()
func (*QueryResponse) ProtoReflect ¶ added in v0.11.0
func (x *QueryResponse) ProtoReflect() protoreflect.Message
func (*QueryResponse) Reset ¶ added in v0.11.0
func (x *QueryResponse) Reset()
func (*QueryResponse) String ¶ added in v0.11.0
func (x *QueryResponse) String() string
type Reconciler ¶ added in v0.24.0
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler reconciles the target and current record sets with the databroker.
func NewReconciler ¶ added in v0.24.0
func NewReconciler( name string, client DataBrokerServiceClient, currentStateBuilder StateBuilderFn, targetStateBuilder StateBuilderFn, setCurrentState func([]*Record), cmpFn RecordCompareFn, opts ...ReconcilerOption, ) *Reconciler
NewReconciler creates a new reconciler
func (*Reconciler) GetDataBrokerServiceClient ¶ added in v0.24.0
func (r *Reconciler) GetDataBrokerServiceClient() DataBrokerServiceClient
GetDataBrokerServiceClient implements the LeaseHandler interface.
func (*Reconciler) Reconcile ¶ added in v0.25.0
func (r *Reconciler) Reconcile(ctx context.Context) error
Reconcile brings databroker state in line with the target state.
func (*Reconciler) Run ¶ added in v0.24.0
func (r *Reconciler) Run(ctx context.Context) error
Run runs the reconciler
func (*Reconciler) RunLeased ¶ added in v0.24.0
func (r *Reconciler) RunLeased(ctx context.Context) error
RunLeased implements the LeaseHandler interface.
func (*Reconciler) TriggerSync ¶ added in v0.24.0
func (r *Reconciler) TriggerSync()
TriggerSync triggers a sync
type ReconcilerOption ¶ added in v0.24.0
type ReconcilerOption func(*reconcilerConfig)
ReconcilerOption is an option for a reconciler.
func WithInterval ¶ added in v0.24.0
func WithInterval(interval time.Duration) ReconcilerOption
WithInterval sets the interval for the reconciler.
type Record ¶
type Record struct { Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` Data *anypb.Any `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` ModifiedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=modified_at,json=modifiedAt,proto3" json:"modified_at,omitempty"` DeletedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` // contains filtered or unexported fields }
func ApplyOffsetAndLimit ¶ added in v0.11.0
ApplyOffsetAndLimit applies the offset and limit to the list of records.
func GetChangeSet ¶ added in v0.24.0
func GetChangeSet(current, target RecordSetBundle, cmpFn RecordCompareFn) []*Record
GetChangeSet returns list of changes between the current and target record sets, that may be applied to the databroker to bring it to the target state.
func InitialSync ¶ added in v0.11.0
func InitialSync( ctx context.Context, client DataBrokerServiceClient, req *SyncLatestRequest, ) (records []*Record, recordVersion, serverVersion uint64, err error)
InitialSync performs a sync latest and then returns all the results.
func NewRecord ¶ added in v0.17.0
func NewRecord(object recordObject) *Record
NewRecord creates a new Record.
func (*Record) Descriptor
deprecated
func (*Record) GetDeletedAt ¶
func (x *Record) GetDeletedAt() *timestamppb.Timestamp
func (*Record) GetModifiedAt ¶
func (x *Record) GetModifiedAt() *timestamppb.Timestamp
func (*Record) GetVersion ¶
func (*Record) MarshalJSON ¶ added in v0.24.0
MarshalJSON marshals the record to JSON.
func (*Record) ProtoMessage ¶
func (*Record) ProtoMessage()
func (*Record) ProtoReflect ¶
func (x *Record) ProtoReflect() protoreflect.Message
func (*Record) UnmarshalJSON ¶ added in v0.24.0
UnmarshalJSON unmarshals the record from JSON.
type RecordCompareFn ¶ added in v0.24.0
RecordCompareFn is a function that compares two records.
type RecordSet ¶ added in v0.24.0
RecordSet is an index of databroker records by their id.
func (RecordSet) GetAdded ¶ added in v0.24.0
GetAdded returns the records that are in other but not in rs.
func (RecordSet) GetModified ¶ added in v0.24.0
func (rs RecordSet) GetModified(other RecordSet, cmpFn RecordCompareFn) RecordSet
GetModified returns the records that are in both rs and other but have different data. by comparing the protobuf bytes of the payload.
func (RecordSet) GetRemoved ¶ added in v0.24.0
GetRemoved returns the records that are in rs but not in other.
type RecordSetBundle ¶ added in v0.24.0
RecordSetBundle is an index of databroker records by type
func (RecordSetBundle) Add ¶ added in v0.24.0
func (rsb RecordSetBundle) Add(record *Record)
Add adds a record to the bundle.
func (RecordSetBundle) Flatten ¶ added in v0.24.0
func (rsb RecordSetBundle) Flatten() []*Record
Flatten returns all records in the bundle.
func (RecordSetBundle) Get ¶ added in v0.24.0
func (rsb RecordSetBundle) Get(typeName, id string) (record *Record, ok bool)
Get returns a record by type and id.
func (RecordSetBundle) GetAdded ¶ added in v0.24.0
func (rsb RecordSetBundle) GetAdded(other RecordSetBundle) RecordSetBundle
GetAdded returns the records that are in other but not in rsb.
func (RecordSetBundle) GetModified ¶ added in v0.24.0
func (rsb RecordSetBundle) GetModified(other RecordSetBundle, cmpFn RecordCompareFn) RecordSetBundle
GetModified returns the records that are in both rs and other but have different data.
func (RecordSetBundle) GetRemoved ¶ added in v0.24.0
func (rsb RecordSetBundle) GetRemoved(other RecordSetBundle) RecordSetBundle
GetRemoved returns the records that are in rs but not in other.
func (RecordSetBundle) RecordTypes ¶ added in v0.24.0
func (rsb RecordSetBundle) RecordTypes() []string
RecordTypes returns the types of records in the bundle.
type ReleaseLeaseRequest ¶ added in v0.15.0
type ReleaseLeaseRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ReleaseLeaseRequest) Descriptor
deprecated
added in
v0.15.0
func (*ReleaseLeaseRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReleaseLeaseRequest.ProtoReflect.Descriptor instead.
func (*ReleaseLeaseRequest) GetId ¶ added in v0.15.0
func (x *ReleaseLeaseRequest) GetId() string
func (*ReleaseLeaseRequest) GetName ¶ added in v0.15.0
func (x *ReleaseLeaseRequest) GetName() string
func (*ReleaseLeaseRequest) ProtoMessage ¶ added in v0.15.0
func (*ReleaseLeaseRequest) ProtoMessage()
func (*ReleaseLeaseRequest) ProtoReflect ¶ added in v0.15.0
func (x *ReleaseLeaseRequest) ProtoReflect() protoreflect.Message
func (*ReleaseLeaseRequest) Reset ¶ added in v0.15.0
func (x *ReleaseLeaseRequest) Reset()
func (*ReleaseLeaseRequest) String ¶ added in v0.15.0
func (x *ReleaseLeaseRequest) String() string
type RenewLeaseRequest ¶ added in v0.15.0
type RenewLeaseRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Duration *durationpb.Duration `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"` // contains filtered or unexported fields }
func (*RenewLeaseRequest) Descriptor
deprecated
added in
v0.15.0
func (*RenewLeaseRequest) Descriptor() ([]byte, []int)
Deprecated: Use RenewLeaseRequest.ProtoReflect.Descriptor instead.
func (*RenewLeaseRequest) GetDuration ¶ added in v0.15.0
func (x *RenewLeaseRequest) GetDuration() *durationpb.Duration
func (*RenewLeaseRequest) GetId ¶ added in v0.15.0
func (x *RenewLeaseRequest) GetId() string
func (*RenewLeaseRequest) GetName ¶ added in v0.15.0
func (x *RenewLeaseRequest) GetName() string
func (*RenewLeaseRequest) ProtoMessage ¶ added in v0.15.0
func (*RenewLeaseRequest) ProtoMessage()
func (*RenewLeaseRequest) ProtoReflect ¶ added in v0.15.0
func (x *RenewLeaseRequest) ProtoReflect() protoreflect.Message
func (*RenewLeaseRequest) Reset ¶ added in v0.15.0
func (x *RenewLeaseRequest) Reset()
func (*RenewLeaseRequest) String ¶ added in v0.15.0
func (x *RenewLeaseRequest) String() string
type SetOptionsRequest ¶ added in v0.14.0
type SetOptionsRequest struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Options *Options `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` // contains filtered or unexported fields }
func (*SetOptionsRequest) Descriptor
deprecated
added in
v0.14.0
func (*SetOptionsRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetOptionsRequest.ProtoReflect.Descriptor instead.
func (*SetOptionsRequest) GetOptions ¶ added in v0.14.0
func (x *SetOptionsRequest) GetOptions() *Options
func (*SetOptionsRequest) GetType ¶ added in v0.14.0
func (x *SetOptionsRequest) GetType() string
func (*SetOptionsRequest) ProtoMessage ¶ added in v0.14.0
func (*SetOptionsRequest) ProtoMessage()
func (*SetOptionsRequest) ProtoReflect ¶ added in v0.14.0
func (x *SetOptionsRequest) ProtoReflect() protoreflect.Message
func (*SetOptionsRequest) Reset ¶ added in v0.14.0
func (x *SetOptionsRequest) Reset()
func (*SetOptionsRequest) String ¶ added in v0.14.0
func (x *SetOptionsRequest) String() string
type SetOptionsResponse ¶ added in v0.14.0
type SetOptionsResponse struct { Options *Options `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` // contains filtered or unexported fields }
func (*SetOptionsResponse) Descriptor
deprecated
added in
v0.14.0
func (*SetOptionsResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetOptionsResponse.ProtoReflect.Descriptor instead.
func (*SetOptionsResponse) GetOptions ¶ added in v0.14.0
func (x *SetOptionsResponse) GetOptions() *Options
func (*SetOptionsResponse) ProtoMessage ¶ added in v0.14.0
func (*SetOptionsResponse) ProtoMessage()
func (*SetOptionsResponse) ProtoReflect ¶ added in v0.14.0
func (x *SetOptionsResponse) ProtoReflect() protoreflect.Message
func (*SetOptionsResponse) Reset ¶ added in v0.14.0
func (x *SetOptionsResponse) Reset()
func (*SetOptionsResponse) String ¶ added in v0.14.0
func (x *SetOptionsResponse) String() string
type StateBuilderFn ¶ added in v0.24.0
type StateBuilderFn func(ctx context.Context) (RecordSetBundle, error)
StateBuilderFn is a function that builds a record set bundle
type SyncLatestRequest ¶ added in v0.14.0
type SyncLatestRequest struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*SyncLatestRequest) Descriptor
deprecated
added in
v0.14.0
func (*SyncLatestRequest) Descriptor() ([]byte, []int)
Deprecated: Use SyncLatestRequest.ProtoReflect.Descriptor instead.
func (*SyncLatestRequest) GetType ¶ added in v0.14.0
func (x *SyncLatestRequest) GetType() string
func (*SyncLatestRequest) ProtoMessage ¶ added in v0.14.0
func (*SyncLatestRequest) ProtoMessage()
func (*SyncLatestRequest) ProtoReflect ¶ added in v0.14.0
func (x *SyncLatestRequest) ProtoReflect() protoreflect.Message
func (*SyncLatestRequest) Reset ¶ added in v0.14.0
func (x *SyncLatestRequest) Reset()
func (*SyncLatestRequest) String ¶ added in v0.14.0
func (x *SyncLatestRequest) String() string
type SyncLatestResponse ¶ added in v0.14.0
type SyncLatestResponse struct { // Types that are assignable to Response: // // *SyncLatestResponse_Record // *SyncLatestResponse_Versions Response isSyncLatestResponse_Response `protobuf_oneof:"response"` // contains filtered or unexported fields }
func (*SyncLatestResponse) Descriptor
deprecated
added in
v0.14.0
func (*SyncLatestResponse) Descriptor() ([]byte, []int)
Deprecated: Use SyncLatestResponse.ProtoReflect.Descriptor instead.
func (*SyncLatestResponse) GetRecord ¶ added in v0.14.0
func (x *SyncLatestResponse) GetRecord() *Record
func (*SyncLatestResponse) GetResponse ¶ added in v0.14.0
func (m *SyncLatestResponse) GetResponse() isSyncLatestResponse_Response
func (*SyncLatestResponse) GetVersions ¶ added in v0.14.0
func (x *SyncLatestResponse) GetVersions() *Versions
func (*SyncLatestResponse) ProtoMessage ¶ added in v0.14.0
func (*SyncLatestResponse) ProtoMessage()
func (*SyncLatestResponse) ProtoReflect ¶ added in v0.14.0
func (x *SyncLatestResponse) ProtoReflect() protoreflect.Message
func (*SyncLatestResponse) Reset ¶ added in v0.14.0
func (x *SyncLatestResponse) Reset()
func (*SyncLatestResponse) String ¶ added in v0.14.0
func (x *SyncLatestResponse) String() string
type SyncLatestResponse_Record ¶ added in v0.14.0
type SyncLatestResponse_Record struct {
Record *Record `protobuf:"bytes,1,opt,name=record,proto3,oneof"`
}
type SyncLatestResponse_Versions ¶ added in v0.14.0
type SyncLatestResponse_Versions struct {
Versions *Versions `protobuf:"bytes,2,opt,name=versions,proto3,oneof"`
}
type SyncRequest ¶
type SyncRequest struct { ServerVersion uint64 `protobuf:"varint,1,opt,name=server_version,json=serverVersion,proto3" json:"server_version,omitempty"` RecordVersion uint64 `protobuf:"varint,2,opt,name=record_version,json=recordVersion,proto3" json:"record_version,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*SyncRequest) Descriptor
deprecated
func (*SyncRequest) Descriptor() ([]byte, []int)
Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead.
func (*SyncRequest) GetRecordVersion ¶
func (x *SyncRequest) GetRecordVersion() uint64
func (*SyncRequest) GetServerVersion ¶
func (x *SyncRequest) GetServerVersion() uint64
func (*SyncRequest) GetType ¶
func (x *SyncRequest) GetType() string
func (*SyncRequest) ProtoMessage ¶
func (*SyncRequest) ProtoMessage()
func (*SyncRequest) ProtoReflect ¶
func (x *SyncRequest) ProtoReflect() protoreflect.Message
func (*SyncRequest) Reset ¶
func (x *SyncRequest) Reset()
func (*SyncRequest) String ¶
func (x *SyncRequest) String() string
type SyncResponse ¶
type SyncResponse struct { Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` // contains filtered or unexported fields }
func (*SyncResponse) Descriptor
deprecated
func (*SyncResponse) Descriptor() ([]byte, []int)
Deprecated: Use SyncResponse.ProtoReflect.Descriptor instead.
func (*SyncResponse) GetRecord ¶ added in v0.14.0
func (x *SyncResponse) GetRecord() *Record
func (*SyncResponse) ProtoMessage ¶
func (*SyncResponse) ProtoMessage()
func (*SyncResponse) ProtoReflect ¶
func (x *SyncResponse) ProtoReflect() protoreflect.Message
func (*SyncResponse) Reset ¶
func (x *SyncResponse) Reset()
func (*SyncResponse) String ¶
func (x *SyncResponse) String() string
type Syncer ¶ added in v0.14.0
type Syncer struct {
// contains filtered or unexported fields
}
A Syncer is a helper type for working with Sync and SyncLatest. It will make a call to SyncLatest to retrieve the latest version of the data, then begin syncing with a call to Sync. If the server version changes `ClearRecords` will be called and the process will start over.
func NewSyncer ¶ added in v0.14.0
func NewSyncer(id string, handler SyncerHandler, options ...SyncerOption) *Syncer
NewSyncer creates a new Syncer.
type SyncerHandler ¶ added in v0.14.0
type SyncerHandler interface { GetDataBrokerServiceClient() DataBrokerServiceClient ClearRecords(ctx context.Context) UpdateRecords(ctx context.Context, serverVersion uint64, records []*Record) }
A SyncerHandler receives sync events from the Syncer.
type SyncerOption ¶ added in v0.14.0
type SyncerOption func(cfg *syncerConfig)
A SyncerOption customizes the syncer configuration.
func WithFastForward ¶ added in v0.15.5
func WithFastForward() SyncerOption
WithFastForward in case updates are coming faster then Update can process them, will skip older records to maintain an update rate. Use for entries that represent a full state snapshot i.e. Config
func WithTypeURL ¶ added in v0.14.0
func WithTypeURL(typeURL string) SyncerOption
WithTypeURL restricts the sync'd results to the given type.
type UnimplementedDataBrokerServiceServer ¶
type UnimplementedDataBrokerServiceServer struct { }
UnimplementedDataBrokerServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedDataBrokerServiceServer) AcquireLease ¶ added in v0.15.0
func (*UnimplementedDataBrokerServiceServer) AcquireLease(context.Context, *AcquireLeaseRequest) (*AcquireLeaseResponse, error)
func (*UnimplementedDataBrokerServiceServer) Get ¶
func (*UnimplementedDataBrokerServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (*UnimplementedDataBrokerServiceServer) ListTypes ¶ added in v0.22.0
func (*UnimplementedDataBrokerServiceServer) ListTypes(context.Context, *emptypb.Empty) (*ListTypesResponse, error)
func (*UnimplementedDataBrokerServiceServer) Patch ¶ added in v0.24.0
func (*UnimplementedDataBrokerServiceServer) Patch(context.Context, *PatchRequest) (*PatchResponse, error)
func (*UnimplementedDataBrokerServiceServer) Put ¶ added in v0.14.0
func (*UnimplementedDataBrokerServiceServer) Put(context.Context, *PutRequest) (*PutResponse, error)
func (*UnimplementedDataBrokerServiceServer) Query ¶ added in v0.11.0
func (*UnimplementedDataBrokerServiceServer) Query(context.Context, *QueryRequest) (*QueryResponse, error)
func (*UnimplementedDataBrokerServiceServer) ReleaseLease ¶ added in v0.15.0
func (*UnimplementedDataBrokerServiceServer) ReleaseLease(context.Context, *ReleaseLeaseRequest) (*emptypb.Empty, error)
func (*UnimplementedDataBrokerServiceServer) RenewLease ¶ added in v0.15.0
func (*UnimplementedDataBrokerServiceServer) RenewLease(context.Context, *RenewLeaseRequest) (*emptypb.Empty, error)
func (*UnimplementedDataBrokerServiceServer) SetOptions ¶ added in v0.14.0
func (*UnimplementedDataBrokerServiceServer) SetOptions(context.Context, *SetOptionsRequest) (*SetOptionsResponse, error)
func (*UnimplementedDataBrokerServiceServer) SyncLatest ¶ added in v0.14.0
func (*UnimplementedDataBrokerServiceServer) SyncLatest(*SyncLatestRequest, DataBrokerService_SyncLatestServer) error
type Versions ¶ added in v0.14.0
type Versions struct { // the server version indicates the version of the server storing the data ServerVersion uint64 `protobuf:"varint,1,opt,name=server_version,json=serverVersion,proto3" json:"server_version,omitempty"` LatestRecordVersion uint64 `protobuf:"varint,2,opt,name=latest_record_version,json=latestRecordVersion,proto3" json:"latest_record_version,omitempty"` // contains filtered or unexported fields }
func (*Versions) Descriptor
deprecated
added in
v0.14.0
func (*Versions) GetLatestRecordVersion ¶ added in v0.14.0
func (*Versions) GetServerVersion ¶ added in v0.14.0
func (*Versions) ProtoMessage ¶ added in v0.14.0
func (*Versions) ProtoMessage()
func (*Versions) ProtoReflect ¶ added in v0.14.0
func (x *Versions) ProtoReflect() protoreflect.Message
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package mock_databroker is a generated GoMock package.
|
Package mock_databroker is a generated GoMock package. |