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.ChainReaderServer
- func RegisterContractReaderService(s *grpc.Server, contractReader types.ContractReader)
- type Client
- 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) 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
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.ChainReaderServer
func RegisterContractReaderService ¶
func RegisterContractReaderService(s *grpc.Server, contractReader types.ContractReader)
Types ¶
type Client ¶
type Client struct { *goplugin.ServiceClient // contains filtered or unexported fields }
func (*Client) GetLatestValue ¶
func (c *Client) GetLatestValue(ctx context.Context, contractName, method string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) error
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 )
enum of all known encoding formats for versioned data.
func (EncodingVersion) Uint32 ¶
func (v EncodingVersion) Uint32() uint32
type Server ¶
type Server struct { pb.UnimplementedChainReaderServer // contains filtered or unexported fields }
func (*Server) GetLatestValue ¶
func (c *Server) GetLatestValue(ctx context.Context, request *pb.GetLatestValueRequest) (*pb.GetLatestValueReply, 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.