Documentation ¶
Index ¶
- Constants
- func DecodeVersionedBytes(res any, vData *pb.VersionedBytes) error
- func EncodeVersionedBytes(data any, version EncodingVersion) (*pb.VersionedBytes, error)
- func NewCodecServer(impl types.Codec) pb.CodecServer
- func NewCodecTestClient(conn *grpc.ClientConn) types.Codec
- func NewServer(impl types.ContractReader, opts ...ServerOpt) pb.ContractReaderServer
- func RegisterContractReaderService(s *grpc.Server, contractReader types.ContractReader)
- type Client
- func (c *Client) BatchGetLatestValues(ctx context.Context, request types.BatchGetLatestValuesRequest) (types.BatchGetLatestValuesResult, error)
- func (c *Client) Bind(ctx context.Context, bindings []types.BoundContract) error
- func (c *Client) ClientConn() grpc.ClientConnInterface
- func (c *Client) Close() error
- func (c *Client) GetLatestValue(ctx context.Context, readIdentifier string, ...) error
- func (c *Client) GetLatestValueWithHeadData(ctx context.Context, readIdentifier string, ...) (*types.Head, error)
- func (c *Client) HealthReport() map[string]error
- func (c *Client) Name() string
- func (c *Client) QueryKey(ctx context.Context, contract types.BoundContract, filter query.KeyFilter, ...) ([]types.Sequence, error)
- func (c *Client) Ready() error
- func (c *Client) Start(ctx context.Context) error
- func (c *Client) Unbind(ctx context.Context, bindings []types.BoundContract) error
- type ClientOpt
- type CodecClient
- func (c *CodecClient) Decode(ctx context.Context, raw []byte, into any, itemType string) error
- func (c *CodecClient) Encode(ctx context.Context, item any, itemType string) ([]byte, error)
- func (c *CodecClient) GetMaxDecodingSize(ctx context.Context, n int, itemType string) (int, error)
- func (c *CodecClient) GetMaxEncodingSize(ctx context.Context, n int, itemType string) (int, error)
- type CodecClientOpt
- type CodecServer
- func (c *CodecServer) GetDecoding(ctx context.Context, req *pb.GetDecodingRequest) (*pb.GetDecodingResponse, error)
- func (c *CodecServer) GetEncoding(ctx context.Context, req *pb.GetEncodingRequest) (*pb.GetEncodingResponse, error)
- func (c *CodecServer) GetMaxSize(ctx context.Context, req *pb.GetMaxSizeRequest) (*pb.GetMaxSizeResponse, error)
- type EncodingVersion
- type Server
- func (c *Server) BatchGetLatestValues(ctx context.Context, pbRequest *pb.BatchGetLatestValuesRequest) (*pb.BatchGetLatestValuesReply, error)
- func (c *Server) Bind(ctx context.Context, bindings *pb.BindRequest) (*emptypb.Empty, error)
- func (c *Server) GetLatestValue(ctx context.Context, request *pb.GetLatestValueRequest) (*pb.GetLatestValueReply, error)
- func (c *Server) GetLatestValueWithHeadData(ctx context.Context, request *pb.GetLatestValueRequest) (*pb.GetLatestValueWithHeadDataReply, error)
- func (c *Server) QueryKey(ctx context.Context, request *pb.QueryKeyRequest) (*pb.QueryKeyReply, error)
- func (c *Server) Unbind(ctx context.Context, bindings *pb.UnbindRequest) (*emptypb.Empty, error)
- type ServerOpt
Constants ¶
View Source
const DefaultEncodingVersion = CBOREncodingVersion
Variables ¶
This section is empty.
Functions ¶
func DecodeVersionedBytes ¶
func DecodeVersionedBytes(res any, vData *pb.VersionedBytes) error
func EncodeVersionedBytes ¶
func EncodeVersionedBytes(data any, version EncodingVersion) (*pb.VersionedBytes, error)
func NewCodecServer ¶
func NewCodecServer(impl types.Codec) pb.CodecServer
func NewCodecTestClient ¶
func NewCodecTestClient(conn *grpc.ClientConn) types.Codec
NewCodecTestClient is a test client for types.Codec internal users should instantiate a client directly and set all private fields.
func NewServer ¶
func NewServer(impl types.ContractReader, opts ...ServerOpt) pb.ContractReaderServer
func RegisterContractReaderService ¶
func RegisterContractReaderService(s *grpc.Server, contractReader types.ContractReader)
Types ¶
type Client ¶
type Client struct { types.UnimplementedContractReader // contains filtered or unexported fields }
func (*Client) BatchGetLatestValues ¶
func (c *Client) BatchGetLatestValues(ctx context.Context, request types.BatchGetLatestValuesRequest) (types.BatchGetLatestValuesResult, error)
func (*Client) ClientConn ¶
func (c *Client) ClientConn() grpc.ClientConnInterface
func (*Client) GetLatestValue ¶
func (c *Client) GetLatestValue(ctx context.Context, readIdentifier string, confidenceLevel primitives.ConfidenceLevel, params, retVal any) error
func (*Client) GetLatestValueWithHeadData ¶
func (c *Client) GetLatestValueWithHeadData(ctx context.Context, readIdentifier string, confidenceLevel primitives.ConfidenceLevel, params, retVal any) (*types.Head, error)
func (*Client) HealthReport ¶
type ClientOpt ¶
type ClientOpt func(*Client)
func WithClientEncoding ¶
func WithClientEncoding(version EncodingVersion) ClientOpt
type CodecClient ¶
func NewCodecClient ¶
func NewCodecClient(b *net.BrokerExt, cc grpc.ClientConnInterface, opts ...CodecClientOpt) *CodecClient
func (*CodecClient) GetMaxDecodingSize ¶
func (*CodecClient) GetMaxEncodingSize ¶
type CodecClientOpt ¶
type CodecClientOpt func(*CodecClient)
func WithCodecClientEncoding ¶
func WithCodecClientEncoding(version EncodingVersion) CodecClientOpt
type CodecServer ¶
type CodecServer struct { pb.UnimplementedCodecServer // contains filtered or unexported fields }
func (*CodecServer) GetDecoding ¶
func (c *CodecServer) GetDecoding(ctx context.Context, req *pb.GetDecodingRequest) (*pb.GetDecodingResponse, error)
func (*CodecServer) GetEncoding ¶
func (c *CodecServer) GetEncoding(ctx context.Context, req *pb.GetEncodingRequest) (*pb.GetEncodingResponse, error)
func (*CodecServer) GetMaxSize ¶
func (c *CodecServer) GetMaxSize(ctx context.Context, req *pb.GetMaxSizeRequest) (*pb.GetMaxSizeResponse, error)
type EncodingVersion ¶
type EncodingVersion uint32
const ( JSONEncodingVersion1 EncodingVersion = iota JSONEncodingVersion2 CBOREncodingVersion ValuesEncodingVersion )
enum of all known encoding formats for versioned data.
func (EncodingVersion) Uint32 ¶
func (v EncodingVersion) Uint32() uint32
type Server ¶
type Server struct { pb.UnimplementedContractReaderServer // contains filtered or unexported fields }
func (*Server) BatchGetLatestValues ¶
func (c *Server) BatchGetLatestValues(ctx context.Context, pbRequest *pb.BatchGetLatestValuesRequest) (*pb.BatchGetLatestValuesReply, error)
func (*Server) GetLatestValue ¶
func (c *Server) GetLatestValue(ctx context.Context, request *pb.GetLatestValueRequest) (*pb.GetLatestValueReply, error)
func (*Server) GetLatestValueWithHeadData ¶
func (c *Server) GetLatestValueWithHeadData(ctx context.Context, request *pb.GetLatestValueRequest) (*pb.GetLatestValueWithHeadDataReply, error)
func (*Server) QueryKey ¶
func (c *Server) QueryKey(ctx context.Context, request *pb.QueryKeyRequest) (*pb.QueryKeyReply, error)
type ServerOpt ¶
type ServerOpt func(*Server)
func WithServerEncoding ¶
func WithServerEncoding(version EncodingVersion) ServerOpt
Click to show internal directories.
Click to hide internal directories.