Versions in this module Expand all Collapse all v0 v0.2.1 Jul 18, 2024 v0.2.0 Jul 15, 2024 Changes in this version + const DefaultEncodingVersion + 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.ChainReaderServer + func RegisterContractReaderService(s *grpc.Server, contractReader types.ContractReader) + type Client struct + func NewClient(b *net.BrokerExt, cc grpc.ClientConnInterface, opts ...ClientOpt) *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) GetLatestValue(ctx context.Context, contractName, method string, ...) error + func (c *Client) QueryKey(ctx context.Context, contractName string, filter query.KeyFilter, ...) ([]types.Sequence, error) + type ClientOpt func(*Client) + func WithClientEncoding(version EncodingVersion) ClientOpt + type CodecClient struct + func NewCodecClient(b *net.BrokerExt, cc grpc.ClientConnInterface, opts ...CodecClientOpt) *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 func(*CodecClient) + func WithCodecClientEncoding(version EncodingVersion) CodecClientOpt + type CodecServer struct + 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 uint32 + const CBOREncodingVersion + const JSONEncodingVersion1 + const JSONEncodingVersion2 + func (v EncodingVersion) Uint32() uint32 + type Server struct + 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) QueryKey(ctx context.Context, request *pb.QueryKeyRequest) (*pb.QueryKeyReply, error) + type ServerOpt func(*Server) + func WithServerEncoding(version EncodingVersion) ServerOpt