Documentation ¶
Overview ¶
Package message defines message types and implements binary message transport for Accumulate API v3.
Message Routing ¶
RoutedTransport can be configured to route messages to the appropriate network. However, some queries cannot be routed without a routing table. The following is an example of how the message client can be initialized with a routing table:
router := new(routing.MessageRouter) transport := &message.RoutedTransport{ Network: "MainNet", Dialer: node.DialNetwork(), Router: router, } client := &message.Client{Transport: transport} ns, err := client.NetworkStatus(ctx, api.NetworkStatusOptions{}) if err != nil { panic(err) } router.Router, err = routing.NewStaticRouter(ns.Routing, nil, nil) if err != nil { panic(err) }
Index ¶
- Variables
- func AddressOf(msg Message) multiaddr.Multiaddr
- func DuplexPipe(ctx context.Context, opts ...pipeOpt) (p, q *pipe[Message])
- func DuplexPipeOf[T any, PT valuePtr[T]](ctx context.Context, opts ...pipeOpt) (p, q *pipe[PT])
- func Equal(a, b Message) bool
- func Pipe(ctx context.Context, opts ...pipeOpt) *pipe[Message]
- func PipeOf[T any, PT valuePtr[T]](ctx context.Context, opts ...pipeOpt) *pipe[PT]
- func QueueDepth(depth int) pipeOpt
- func RegisterMessageType[P msgStructPtr[T], T any](name string) error
- type Addressed
- func (v *Addressed) Copy() *Addressed
- func (v *Addressed) CopyAsInterface() interface{}
- func (v *Addressed) Equal(u *Addressed) bool
- func (v *Addressed) IsValid() error
- func (v *Addressed) MarshalBinary() ([]byte, error)
- func (v *Addressed) MarshalJSON() ([]byte, error)
- func (*Addressed) Type() Type
- func (v *Addressed) UnmarshalBinary(data []byte) error
- func (v *Addressed) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *Addressed) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *Addressed) UnmarshalJSON(data []byte) error
- type AddressedClient
- func (c AddressedClient) ConsensusStatus(ctx context.Context, opts api.ConsensusStatusOptions) (*api.ConsensusStatus, error)
- func (c AddressedClient) Faucet(ctx context.Context, account *url.URL, opts api.FaucetOptions) (*api.Submission, error)
- func (c AddressedClient) FindService(ctx context.Context, opts api.FindServiceOptions) ([]*api.FindServiceResult, error)
- func (c AddressedClient) ForAddress(addr multiaddr.Multiaddr) AddressedClient
- func (c AddressedClient) ForPeer(peer peer.ID) AddressedClient
- func (c AddressedClient) Metrics(ctx context.Context, opts api.MetricsOptions) (*api.Metrics, error)
- func (c AddressedClient) NetworkStatus(ctx context.Context, opts api.NetworkStatusOptions) (*api.NetworkStatus, error)
- func (c AddressedClient) NodeInfo(ctx context.Context, opts api.NodeInfoOptions) (*api.NodeInfo, error)
- func (c AddressedClient) Private() private.Sequencer
- func (c AddressedClient) Query(ctx context.Context, scope *url.URL, query api.Query) (api.Record, error)
- func (c AddressedClient) Submit(ctx context.Context, envelope *messaging.Envelope, opts api.SubmitOptions) ([]*api.Submission, error)
- func (c AddressedClient) Validate(ctx context.Context, envelope *messaging.Envelope, opts api.ValidateOptions) ([]*api.Submission, error)
- type Client
- func (c *Client) ConsensusStatus(ctx context.Context, opts api.ConsensusStatusOptions) (*api.ConsensusStatus, error)
- func (c *Client) Faucet(ctx context.Context, account *url.URL, opts api.FaucetOptions) (*api.Submission, error)
- func (c *Client) FindService(ctx context.Context, opts api.FindServiceOptions) ([]*api.FindServiceResult, error)
- func (c *Client) ForAddress(addr multiaddr.Multiaddr) AddressedClient
- func (c *Client) ForPeer(peer peer.ID) AddressedClient
- func (c *Client) Metrics(ctx context.Context, opts api.MetricsOptions) (*api.Metrics, error)
- func (c *Client) NetworkStatus(ctx context.Context, opts api.NetworkStatusOptions) (*api.NetworkStatus, error)
- func (c *Client) NodeInfo(ctx context.Context, opts api.NodeInfoOptions) (*api.NodeInfo, error)
- func (c *Client) Private() private.Sequencer
- func (c *Client) Query(ctx context.Context, scope *url.URL, query api.Query) (api.Record, error)
- func (c *Client) Submit(ctx context.Context, envelope *messaging.Envelope, opts api.SubmitOptions) ([]*api.Submission, error)
- func (c *Client) Subscribe(ctx context.Context, opts api.SubscribeOptions) (<-chan api.Event, error)
- func (c *Client) Validate(ctx context.Context, envelope *messaging.Envelope, opts api.ValidateOptions) ([]*api.Submission, error)
- type ConsensusService
- type ConsensusStatusRequest
- func (v *ConsensusStatusRequest) Copy() *ConsensusStatusRequest
- func (v *ConsensusStatusRequest) CopyAsInterface() interface{}
- func (v *ConsensusStatusRequest) Equal(u *ConsensusStatusRequest) bool
- func (v *ConsensusStatusRequest) IsValid() error
- func (v *ConsensusStatusRequest) MarshalBinary() ([]byte, error)
- func (v *ConsensusStatusRequest) MarshalJSON() ([]byte, error)
- func (*ConsensusStatusRequest) Type() Type
- func (v *ConsensusStatusRequest) UnmarshalBinary(data []byte) error
- func (v *ConsensusStatusRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *ConsensusStatusRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *ConsensusStatusRequest) UnmarshalJSON(data []byte) error
- type ConsensusStatusResponse
- func (v *ConsensusStatusResponse) Copy() *ConsensusStatusResponse
- func (v *ConsensusStatusResponse) CopyAsInterface() interface{}
- func (v *ConsensusStatusResponse) Equal(u *ConsensusStatusResponse) bool
- func (v *ConsensusStatusResponse) IsValid() error
- func (v *ConsensusStatusResponse) MarshalBinary() ([]byte, error)
- func (v *ConsensusStatusResponse) MarshalJSON() ([]byte, error)
- func (*ConsensusStatusResponse) Type() Type
- func (v *ConsensusStatusResponse) UnmarshalBinary(data []byte) error
- func (v *ConsensusStatusResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *ConsensusStatusResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *ConsensusStatusResponse) UnmarshalJSON(data []byte) error
- type Dialer
- type ErrorResponse
- func (v *ErrorResponse) Copy() *ErrorResponse
- func (v *ErrorResponse) CopyAsInterface() interface{}
- func (v *ErrorResponse) Equal(u *ErrorResponse) bool
- func (v *ErrorResponse) IsValid() error
- func (v *ErrorResponse) MarshalBinary() ([]byte, error)
- func (v *ErrorResponse) MarshalJSON() ([]byte, error)
- func (*ErrorResponse) Type() Type
- func (v *ErrorResponse) UnmarshalBinary(data []byte) error
- func (v *ErrorResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *ErrorResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *ErrorResponse) UnmarshalJSON(data []byte) error
- type EventMessage
- func (v *EventMessage) Copy() *EventMessage
- func (v *EventMessage) CopyAsInterface() interface{}
- func (v *EventMessage) Equal(u *EventMessage) bool
- func (v *EventMessage) IsValid() error
- func (v *EventMessage) MarshalBinary() ([]byte, error)
- func (v *EventMessage) MarshalJSON() ([]byte, error)
- func (*EventMessage) Type() Type
- func (v *EventMessage) UnmarshalBinary(data []byte) error
- func (v *EventMessage) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *EventMessage) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *EventMessage) UnmarshalJSON(data []byte) error
- type EventService
- type Faucet
- type FaucetRequest
- func (v *FaucetRequest) Copy() *FaucetRequest
- func (v *FaucetRequest) CopyAsInterface() interface{}
- func (v *FaucetRequest) Equal(u *FaucetRequest) bool
- func (v *FaucetRequest) IsValid() error
- func (v *FaucetRequest) MarshalBinary() ([]byte, error)
- func (v *FaucetRequest) MarshalJSON() ([]byte, error)
- func (*FaucetRequest) Type() Type
- func (v *FaucetRequest) UnmarshalBinary(data []byte) error
- func (v *FaucetRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *FaucetRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *FaucetRequest) UnmarshalJSON(data []byte) error
- type FaucetResponse
- func (v *FaucetResponse) Copy() *FaucetResponse
- func (v *FaucetResponse) CopyAsInterface() interface{}
- func (v *FaucetResponse) Equal(u *FaucetResponse) bool
- func (v *FaucetResponse) IsValid() error
- func (v *FaucetResponse) MarshalBinary() ([]byte, error)
- func (v *FaucetResponse) MarshalJSON() ([]byte, error)
- func (*FaucetResponse) Type() Type
- func (v *FaucetResponse) UnmarshalBinary(data []byte) error
- func (v *FaucetResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *FaucetResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *FaucetResponse) UnmarshalJSON(data []byte) error
- type FindServiceRequest
- func (v *FindServiceRequest) Copy() *FindServiceRequest
- func (v *FindServiceRequest) CopyAsInterface() interface{}
- func (v *FindServiceRequest) Equal(u *FindServiceRequest) bool
- func (v *FindServiceRequest) IsValid() error
- func (v *FindServiceRequest) MarshalBinary() ([]byte, error)
- func (v *FindServiceRequest) MarshalJSON() ([]byte, error)
- func (*FindServiceRequest) Type() Type
- func (v *FindServiceRequest) UnmarshalBinary(data []byte) error
- func (v *FindServiceRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *FindServiceRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *FindServiceRequest) UnmarshalJSON(data []byte) error
- type FindServiceResponse
- func (v *FindServiceResponse) Copy() *FindServiceResponse
- func (v *FindServiceResponse) CopyAsInterface() interface{}
- func (v *FindServiceResponse) Equal(u *FindServiceResponse) bool
- func (v *FindServiceResponse) IsValid() error
- func (v *FindServiceResponse) MarshalBinary() ([]byte, error)
- func (v *FindServiceResponse) MarshalJSON() ([]byte, error)
- func (*FindServiceResponse) Type() Type
- func (v *FindServiceResponse) UnmarshalBinary(data []byte) error
- func (v *FindServiceResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *FindServiceResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *FindServiceResponse) UnmarshalJSON(data []byte) error
- type Handler
- type Message
- type MetricsRequest
- func (v *MetricsRequest) Copy() *MetricsRequest
- func (v *MetricsRequest) CopyAsInterface() interface{}
- func (v *MetricsRequest) Equal(u *MetricsRequest) bool
- func (v *MetricsRequest) IsValid() error
- func (v *MetricsRequest) MarshalBinary() ([]byte, error)
- func (v *MetricsRequest) MarshalJSON() ([]byte, error)
- func (*MetricsRequest) Type() Type
- func (v *MetricsRequest) UnmarshalBinary(data []byte) error
- func (v *MetricsRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *MetricsRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *MetricsRequest) UnmarshalJSON(data []byte) error
- type MetricsResponse
- func (v *MetricsResponse) Copy() *MetricsResponse
- func (v *MetricsResponse) CopyAsInterface() interface{}
- func (v *MetricsResponse) Equal(u *MetricsResponse) bool
- func (v *MetricsResponse) IsValid() error
- func (v *MetricsResponse) MarshalBinary() ([]byte, error)
- func (v *MetricsResponse) MarshalJSON() ([]byte, error)
- func (*MetricsResponse) Type() Type
- func (v *MetricsResponse) UnmarshalBinary(data []byte) error
- func (v *MetricsResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *MetricsResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *MetricsResponse) UnmarshalJSON(data []byte) error
- type MetricsService
- type MultiDialer
- type NetworkService
- type NetworkStatusRequest
- func (v *NetworkStatusRequest) Copy() *NetworkStatusRequest
- func (v *NetworkStatusRequest) CopyAsInterface() interface{}
- func (v *NetworkStatusRequest) Equal(u *NetworkStatusRequest) bool
- func (v *NetworkStatusRequest) IsValid() error
- func (v *NetworkStatusRequest) MarshalBinary() ([]byte, error)
- func (v *NetworkStatusRequest) MarshalJSON() ([]byte, error)
- func (*NetworkStatusRequest) Type() Type
- func (v *NetworkStatusRequest) UnmarshalBinary(data []byte) error
- func (v *NetworkStatusRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *NetworkStatusRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *NetworkStatusRequest) UnmarshalJSON(data []byte) error
- type NetworkStatusResponse
- func (v *NetworkStatusResponse) Copy() *NetworkStatusResponse
- func (v *NetworkStatusResponse) CopyAsInterface() interface{}
- func (v *NetworkStatusResponse) Equal(u *NetworkStatusResponse) bool
- func (v *NetworkStatusResponse) IsValid() error
- func (v *NetworkStatusResponse) MarshalBinary() ([]byte, error)
- func (v *NetworkStatusResponse) MarshalJSON() ([]byte, error)
- func (*NetworkStatusResponse) Type() Type
- func (v *NetworkStatusResponse) UnmarshalBinary(data []byte) error
- func (v *NetworkStatusResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *NetworkStatusResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *NetworkStatusResponse) UnmarshalJSON(data []byte) error
- type NodeInfoRequest
- func (v *NodeInfoRequest) Copy() *NodeInfoRequest
- func (v *NodeInfoRequest) CopyAsInterface() interface{}
- func (v *NodeInfoRequest) Equal(u *NodeInfoRequest) bool
- func (v *NodeInfoRequest) IsValid() error
- func (v *NodeInfoRequest) MarshalBinary() ([]byte, error)
- func (v *NodeInfoRequest) MarshalJSON() ([]byte, error)
- func (*NodeInfoRequest) Type() Type
- func (v *NodeInfoRequest) UnmarshalBinary(data []byte) error
- func (v *NodeInfoRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *NodeInfoRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *NodeInfoRequest) UnmarshalJSON(data []byte) error
- type NodeInfoResponse
- func (v *NodeInfoResponse) Copy() *NodeInfoResponse
- func (v *NodeInfoResponse) CopyAsInterface() interface{}
- func (v *NodeInfoResponse) Equal(u *NodeInfoResponse) bool
- func (v *NodeInfoResponse) IsValid() error
- func (v *NodeInfoResponse) MarshalBinary() ([]byte, error)
- func (v *NodeInfoResponse) MarshalJSON() ([]byte, error)
- func (*NodeInfoResponse) Type() Type
- func (v *NodeInfoResponse) UnmarshalBinary(data []byte) error
- func (v *NodeInfoResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *NodeInfoResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *NodeInfoResponse) UnmarshalJSON(data []byte) error
- type NodeService
- type PrivateClient
- type PrivateSequenceRequest
- func (v *PrivateSequenceRequest) Copy() *PrivateSequenceRequest
- func (v *PrivateSequenceRequest) CopyAsInterface() interface{}
- func (v *PrivateSequenceRequest) Equal(u *PrivateSequenceRequest) bool
- func (v *PrivateSequenceRequest) IsValid() error
- func (v *PrivateSequenceRequest) MarshalBinary() ([]byte, error)
- func (v *PrivateSequenceRequest) MarshalJSON() ([]byte, error)
- func (*PrivateSequenceRequest) Type() Type
- func (v *PrivateSequenceRequest) UnmarshalBinary(data []byte) error
- func (v *PrivateSequenceRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *PrivateSequenceRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *PrivateSequenceRequest) UnmarshalJSON(data []byte) error
- type PrivateSequenceResponse
- func (v *PrivateSequenceResponse) Copy() *PrivateSequenceResponse
- func (v *PrivateSequenceResponse) CopyAsInterface() interface{}
- func (v *PrivateSequenceResponse) Equal(u *PrivateSequenceResponse) bool
- func (v *PrivateSequenceResponse) IsValid() error
- func (v *PrivateSequenceResponse) MarshalBinary() ([]byte, error)
- func (v *PrivateSequenceResponse) MarshalJSON() ([]byte, error)
- func (*PrivateSequenceResponse) Type() Type
- func (v *PrivateSequenceResponse) UnmarshalBinary(data []byte) error
- func (v *PrivateSequenceResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *PrivateSequenceResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *PrivateSequenceResponse) UnmarshalJSON(data []byte) error
- type Querier
- type QueryRequest
- func (v *QueryRequest) Copy() *QueryRequest
- func (v *QueryRequest) CopyAsInterface() interface{}
- func (v *QueryRequest) Equal(u *QueryRequest) bool
- func (v *QueryRequest) IsValid() error
- func (v *QueryRequest) MarshalBinary() ([]byte, error)
- func (v *QueryRequest) MarshalJSON() ([]byte, error)
- func (*QueryRequest) Type() Type
- func (v *QueryRequest) UnmarshalBinary(data []byte) error
- func (v *QueryRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *QueryRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *QueryRequest) UnmarshalJSON(data []byte) error
- type RecordResponse
- func (v *RecordResponse) Copy() *RecordResponse
- func (v *RecordResponse) CopyAsInterface() interface{}
- func (v *RecordResponse) Equal(u *RecordResponse) bool
- func (v *RecordResponse) IsValid() error
- func (v *RecordResponse) MarshalBinary() ([]byte, error)
- func (v *RecordResponse) MarshalJSON() ([]byte, error)
- func (*RecordResponse) Type() Type
- func (v *RecordResponse) UnmarshalBinary(data []byte) error
- func (v *RecordResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *RecordResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *RecordResponse) UnmarshalJSON(data []byte) error
- type ResponseCallback
- type RoutedTransport
- type Router
- type Sequencer
- type Service
- type Stream
- type StreamOf
- type SubmitRequest
- func (v *SubmitRequest) Copy() *SubmitRequest
- func (v *SubmitRequest) CopyAsInterface() interface{}
- func (v *SubmitRequest) Equal(u *SubmitRequest) bool
- func (v *SubmitRequest) IsValid() error
- func (v *SubmitRequest) MarshalBinary() ([]byte, error)
- func (v *SubmitRequest) MarshalJSON() ([]byte, error)
- func (*SubmitRequest) Type() Type
- func (v *SubmitRequest) UnmarshalBinary(data []byte) error
- func (v *SubmitRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *SubmitRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *SubmitRequest) UnmarshalJSON(data []byte) error
- type SubmitResponse
- func (v *SubmitResponse) Copy() *SubmitResponse
- func (v *SubmitResponse) CopyAsInterface() interface{}
- func (v *SubmitResponse) Equal(u *SubmitResponse) bool
- func (v *SubmitResponse) IsValid() error
- func (v *SubmitResponse) MarshalBinary() ([]byte, error)
- func (v *SubmitResponse) MarshalJSON() ([]byte, error)
- func (*SubmitResponse) Type() Type
- func (v *SubmitResponse) UnmarshalBinary(data []byte) error
- func (v *SubmitResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *SubmitResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *SubmitResponse) UnmarshalJSON(data []byte) error
- type Submitter
- type SubscribeRequest
- func (v *SubscribeRequest) Copy() *SubscribeRequest
- func (v *SubscribeRequest) CopyAsInterface() interface{}
- func (v *SubscribeRequest) Equal(u *SubscribeRequest) bool
- func (v *SubscribeRequest) IsValid() error
- func (v *SubscribeRequest) MarshalBinary() ([]byte, error)
- func (v *SubscribeRequest) MarshalJSON() ([]byte, error)
- func (*SubscribeRequest) Type() Type
- func (v *SubscribeRequest) UnmarshalBinary(data []byte) error
- func (v *SubscribeRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *SubscribeRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *SubscribeRequest) UnmarshalJSON(data []byte) error
- type SubscribeResponse
- func (v *SubscribeResponse) Copy() *SubscribeResponse
- func (v *SubscribeResponse) CopyAsInterface() interface{}
- func (v *SubscribeResponse) Equal(u *SubscribeResponse) bool
- func (v *SubscribeResponse) IsValid() error
- func (v *SubscribeResponse) MarshalBinary() ([]byte, error)
- func (v *SubscribeResponse) MarshalJSON() ([]byte, error)
- func (*SubscribeResponse) Type() Type
- func (v *SubscribeResponse) UnmarshalBinary(data []byte) error
- func (v *SubscribeResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *SubscribeResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *SubscribeResponse) UnmarshalJSON(data []byte) error
- type Transport
- type Type
- type ValidateRequest
- func (v *ValidateRequest) Copy() *ValidateRequest
- func (v *ValidateRequest) CopyAsInterface() interface{}
- func (v *ValidateRequest) Equal(u *ValidateRequest) bool
- func (v *ValidateRequest) IsValid() error
- func (v *ValidateRequest) MarshalBinary() ([]byte, error)
- func (v *ValidateRequest) MarshalJSON() ([]byte, error)
- func (*ValidateRequest) Type() Type
- func (v *ValidateRequest) UnmarshalBinary(data []byte) error
- func (v *ValidateRequest) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *ValidateRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *ValidateRequest) UnmarshalJSON(data []byte) error
- type ValidateResponse
- func (v *ValidateResponse) Copy() *ValidateResponse
- func (v *ValidateResponse) CopyAsInterface() interface{}
- func (v *ValidateResponse) Equal(u *ValidateResponse) bool
- func (v *ValidateResponse) IsValid() error
- func (v *ValidateResponse) MarshalBinary() ([]byte, error)
- func (v *ValidateResponse) MarshalJSON() ([]byte, error)
- func (*ValidateResponse) Type() Type
- func (v *ValidateResponse) UnmarshalBinary(data []byte) error
- func (v *ValidateResponse) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *ValidateResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
- func (v *ValidateResponse) UnmarshalJSON(data []byte) error
- type Validator
Constants ¶
This section is empty.
Variables ¶
var ErrDeadline = stderr.New("deadline exceeded")
ErrDeadline is returned if a pipe read or write exceeds the deadline.
Functions ¶
func AddressOf ¶
func AddressOf(msg Message) multiaddr.Multiaddr
AddressOf returns the message's address if it is an Addressed.
func DuplexPipe ¶
DuplexPipe allocates a pair of duplex Message [Stream]s backed by a pair of unbuffered channels.
func DuplexPipeOf ¶
DuplexPipeOf allocates a pair of duplex [Stream]s of *T backed by a pair of unbuffered channels. *T must implement encoding.BinaryValue.
func PipeOf ¶
PipeOf allocates a simplex Stream of *T backed by an unbuffered channel. *T must implement encoding.BinaryValue.
func QueueDepth ¶ added in v1.2.10
func QueueDepth(depth int) pipeOpt
func RegisterMessageType ¶
RegisterMessageType registers a message type.
Types ¶
type Addressed ¶
type Addressed struct { Message Message `json:"message,omitempty" form:"message" query:"message" validate:"required"` Address p2p.Multiaddr `json:"address,omitempty" form:"address" query:"address" validate:"required"` // contains filtered or unexported fields }
func (*Addressed) CopyAsInterface ¶
func (v *Addressed) CopyAsInterface() interface{}
func (*Addressed) MarshalBinary ¶
func (*Addressed) MarshalJSON ¶
func (*Addressed) UnmarshalBinary ¶
func (*Addressed) UnmarshalFieldsFrom ¶
func (*Addressed) UnmarshalJSON ¶
type AddressedClient ¶ added in v1.2.0
type AddressedClient struct { *Client Address multiaddr.Multiaddr }
func (AddressedClient) ConsensusStatus ¶ added in v1.2.0
func (c AddressedClient) ConsensusStatus(ctx context.Context, opts api.ConsensusStatusOptions) (*api.ConsensusStatus, error)
ConsensusStatus implements api.NodeService.ConsensusStatus.
func (AddressedClient) Faucet ¶ added in v1.2.0
func (c AddressedClient) Faucet(ctx context.Context, account *url.URL, opts api.FaucetOptions) (*api.Submission, error)
Faucet implements api.Faucet.Faucet.
func (AddressedClient) FindService ¶ added in v1.2.0
func (c AddressedClient) FindService(ctx context.Context, opts api.FindServiceOptions) ([]*api.FindServiceResult, error)
FindService implements api.NodeService.FindService.
func (AddressedClient) ForAddress ¶ added in v1.4.0
func (c AddressedClient) ForAddress(addr multiaddr.Multiaddr) AddressedClient
func (AddressedClient) ForPeer ¶ added in v1.4.0
func (c AddressedClient) ForPeer(peer peer.ID) AddressedClient
func (AddressedClient) Metrics ¶ added in v1.2.0
func (c AddressedClient) Metrics(ctx context.Context, opts api.MetricsOptions) (*api.Metrics, error)
Metrics implements api.MetricsService.Metrics.
func (AddressedClient) NetworkStatus ¶ added in v1.2.0
func (c AddressedClient) NetworkStatus(ctx context.Context, opts api.NetworkStatusOptions) (*api.NetworkStatus, error)
NetworkStatus implements api.NetworkService.NetworkStatus.
func (AddressedClient) NodeInfo ¶ added in v1.2.0
func (c AddressedClient) NodeInfo(ctx context.Context, opts api.NodeInfoOptions) (*api.NodeInfo, error)
NodeInfo implements api.NodeService.NodeInfo.
func (AddressedClient) Private ¶ added in v1.2.0
func (c AddressedClient) Private() private.Sequencer
Private returns a PrivateClient.
func (AddressedClient) Query ¶ added in v1.2.0
func (c AddressedClient) Query(ctx context.Context, scope *url.URL, query api.Query) (api.Record, error)
Query implements api.Querier.Query.
func (AddressedClient) Submit ¶ added in v1.2.0
func (c AddressedClient) Submit(ctx context.Context, envelope *messaging.Envelope, opts api.SubmitOptions) ([]*api.Submission, error)
Submit implements api.Submitter.Submit.
func (AddressedClient) Validate ¶ added in v1.2.0
func (c AddressedClient) Validate(ctx context.Context, envelope *messaging.Envelope, opts api.ValidateOptions) ([]*api.Submission, error)
Validate implements api.Validator.Validate.
type Client ¶
type Client struct {
Transport Transport
}
Client is a binary message client for API v3.
func (*Client) ConsensusStatus ¶
func (c *Client) ConsensusStatus(ctx context.Context, opts api.ConsensusStatusOptions) (*api.ConsensusStatus, error)
ConsensusStatus implements api.NodeService.ConsensusStatus.
func (*Client) Faucet ¶
func (c *Client) Faucet(ctx context.Context, account *url.URL, opts api.FaucetOptions) (*api.Submission, error)
Faucet implements api.Faucet.Faucet.
func (*Client) FindService ¶
func (c *Client) FindService(ctx context.Context, opts api.FindServiceOptions) ([]*api.FindServiceResult, error)
FindService implements api.NodeService.FindService.
func (*Client) ForAddress ¶ added in v1.2.0
func (c *Client) ForAddress(addr multiaddr.Multiaddr) AddressedClient
func (*Client) Metrics ¶
Metrics implements api.MetricsService.Metrics.
func (*Client) NetworkStatus ¶
func (c *Client) NetworkStatus(ctx context.Context, opts api.NetworkStatusOptions) (*api.NetworkStatus, error)
NetworkStatus implements api.NetworkService.NetworkStatus.
func (*Client) NodeInfo ¶
NodeInfo implements api.NodeService.NodeInfo.
func (*Client) Private ¶
Private returns a PrivateClient.
func (*Client) Query ¶
Query implements api.Querier.Query.
func (*Client) Submit ¶
func (c *Client) Submit(ctx context.Context, envelope *messaging.Envelope, opts api.SubmitOptions) ([]*api.Submission, error)
Submit implements api.Submitter.Submit.
type ConsensusService ¶
type ConsensusService struct {
api.ConsensusService
}
ConsensusService forwards [NodeStatusRequest]s to a api.ConsensusService.
type ConsensusStatusRequest ¶
type ConsensusStatusRequest struct { api.ConsensusStatusOptions // contains filtered or unexported fields }
func (*ConsensusStatusRequest) Copy ¶
func (v *ConsensusStatusRequest) Copy() *ConsensusStatusRequest
func (*ConsensusStatusRequest) CopyAsInterface ¶
func (v *ConsensusStatusRequest) CopyAsInterface() interface{}
func (*ConsensusStatusRequest) Equal ¶
func (v *ConsensusStatusRequest) Equal(u *ConsensusStatusRequest) bool
func (*ConsensusStatusRequest) IsValid ¶
func (v *ConsensusStatusRequest) IsValid() error
func (*ConsensusStatusRequest) MarshalBinary ¶
func (v *ConsensusStatusRequest) MarshalBinary() ([]byte, error)
func (*ConsensusStatusRequest) MarshalJSON ¶
func (v *ConsensusStatusRequest) MarshalJSON() ([]byte, error)
func (*ConsensusStatusRequest) Type ¶
func (*ConsensusStatusRequest) Type() Type
func (*ConsensusStatusRequest) UnmarshalBinary ¶
func (v *ConsensusStatusRequest) UnmarshalBinary(data []byte) error
func (*ConsensusStatusRequest) UnmarshalBinaryFrom ¶
func (v *ConsensusStatusRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*ConsensusStatusRequest) UnmarshalFieldsFrom ¶
func (v *ConsensusStatusRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*ConsensusStatusRequest) UnmarshalJSON ¶
func (v *ConsensusStatusRequest) UnmarshalJSON(data []byte) error
type ConsensusStatusResponse ¶
type ConsensusStatusResponse struct { Value *api.ConsensusStatus `json:"value,omitempty" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*ConsensusStatusResponse) Copy ¶
func (v *ConsensusStatusResponse) Copy() *ConsensusStatusResponse
func (*ConsensusStatusResponse) CopyAsInterface ¶
func (v *ConsensusStatusResponse) CopyAsInterface() interface{}
func (*ConsensusStatusResponse) Equal ¶
func (v *ConsensusStatusResponse) Equal(u *ConsensusStatusResponse) bool
func (*ConsensusStatusResponse) IsValid ¶
func (v *ConsensusStatusResponse) IsValid() error
func (*ConsensusStatusResponse) MarshalBinary ¶
func (v *ConsensusStatusResponse) MarshalBinary() ([]byte, error)
func (*ConsensusStatusResponse) MarshalJSON ¶
func (v *ConsensusStatusResponse) MarshalJSON() ([]byte, error)
func (*ConsensusStatusResponse) Type ¶
func (*ConsensusStatusResponse) Type() Type
func (*ConsensusStatusResponse) UnmarshalBinary ¶
func (v *ConsensusStatusResponse) UnmarshalBinary(data []byte) error
func (*ConsensusStatusResponse) UnmarshalBinaryFrom ¶
func (v *ConsensusStatusResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*ConsensusStatusResponse) UnmarshalFieldsFrom ¶
func (v *ConsensusStatusResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*ConsensusStatusResponse) UnmarshalJSON ¶
func (v *ConsensusStatusResponse) UnmarshalJSON(data []byte) error
type Dialer ¶
type Dialer interface { // Dial returns a stream for the given address. The caller must cancel the // context once the stream is no longer needed. The dialer is responsible // for cleaning up the stream once the context has been canceled. Dial(context.Context, multiaddr.Multiaddr) (Stream, error) }
A Dialer dials an address, returning a message stream.
func BatchDialer ¶
BatchDialer returns a dialer that reuses streams. BatchDialer ignores the contexts passed to Dial and BadDial and uses the context passed to BatchDialer instead. Thus the context must be canceled to close all the dialed streams.
If the dialer is a MultiDialer, calls to BadDial will be forwarded.
type ErrorResponse ¶
type ErrorResponse struct { Error *errors2.Error `json:"error,omitempty" form:"error" query:"error" validate:"required"` // contains filtered or unexported fields }
func (*ErrorResponse) Copy ¶
func (v *ErrorResponse) Copy() *ErrorResponse
func (*ErrorResponse) CopyAsInterface ¶
func (v *ErrorResponse) CopyAsInterface() interface{}
func (*ErrorResponse) Equal ¶
func (v *ErrorResponse) Equal(u *ErrorResponse) bool
func (*ErrorResponse) IsValid ¶
func (v *ErrorResponse) IsValid() error
func (*ErrorResponse) MarshalBinary ¶
func (v *ErrorResponse) MarshalBinary() ([]byte, error)
func (*ErrorResponse) MarshalJSON ¶
func (v *ErrorResponse) MarshalJSON() ([]byte, error)
func (*ErrorResponse) Type ¶
func (*ErrorResponse) Type() Type
func (*ErrorResponse) UnmarshalBinary ¶
func (v *ErrorResponse) UnmarshalBinary(data []byte) error
func (*ErrorResponse) UnmarshalBinaryFrom ¶
func (v *ErrorResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*ErrorResponse) UnmarshalFieldsFrom ¶
func (v *ErrorResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*ErrorResponse) UnmarshalJSON ¶
func (v *ErrorResponse) UnmarshalJSON(data []byte) error
type EventMessage ¶
type EventMessage struct { Value []api.Event `json:"value" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*EventMessage) Copy ¶
func (v *EventMessage) Copy() *EventMessage
func (*EventMessage) CopyAsInterface ¶
func (v *EventMessage) CopyAsInterface() interface{}
func (*EventMessage) Equal ¶
func (v *EventMessage) Equal(u *EventMessage) bool
func (*EventMessage) IsValid ¶
func (v *EventMessage) IsValid() error
func (*EventMessage) MarshalBinary ¶
func (v *EventMessage) MarshalBinary() ([]byte, error)
func (*EventMessage) MarshalJSON ¶
func (v *EventMessage) MarshalJSON() ([]byte, error)
func (*EventMessage) Type ¶
func (*EventMessage) Type() Type
func (*EventMessage) UnmarshalBinary ¶
func (v *EventMessage) UnmarshalBinary(data []byte) error
func (*EventMessage) UnmarshalBinaryFrom ¶
func (v *EventMessage) UnmarshalBinaryFrom(rd io.Reader) error
func (*EventMessage) UnmarshalFieldsFrom ¶
func (v *EventMessage) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*EventMessage) UnmarshalJSON ¶
func (v *EventMessage) UnmarshalJSON(data []byte) error
type EventService ¶
type EventService struct {
api.EventService
}
func (EventService) Subscribe ¶
func (s EventService) Subscribe(c *call[*SubscribeRequest])
type FaucetRequest ¶
type FaucetRequest struct { Account *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"` api.FaucetOptions // contains filtered or unexported fields }
func (*FaucetRequest) Copy ¶
func (v *FaucetRequest) Copy() *FaucetRequest
func (*FaucetRequest) CopyAsInterface ¶
func (v *FaucetRequest) CopyAsInterface() interface{}
func (*FaucetRequest) Equal ¶
func (v *FaucetRequest) Equal(u *FaucetRequest) bool
func (*FaucetRequest) IsValid ¶
func (v *FaucetRequest) IsValid() error
func (*FaucetRequest) MarshalBinary ¶
func (v *FaucetRequest) MarshalBinary() ([]byte, error)
func (*FaucetRequest) MarshalJSON ¶
func (v *FaucetRequest) MarshalJSON() ([]byte, error)
func (*FaucetRequest) Type ¶
func (*FaucetRequest) Type() Type
func (*FaucetRequest) UnmarshalBinary ¶
func (v *FaucetRequest) UnmarshalBinary(data []byte) error
func (*FaucetRequest) UnmarshalBinaryFrom ¶
func (v *FaucetRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*FaucetRequest) UnmarshalFieldsFrom ¶
func (v *FaucetRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*FaucetRequest) UnmarshalJSON ¶
func (v *FaucetRequest) UnmarshalJSON(data []byte) error
type FaucetResponse ¶
type FaucetResponse struct { Value *api.Submission `json:"value,omitempty" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*FaucetResponse) Copy ¶
func (v *FaucetResponse) Copy() *FaucetResponse
func (*FaucetResponse) CopyAsInterface ¶
func (v *FaucetResponse) CopyAsInterface() interface{}
func (*FaucetResponse) Equal ¶
func (v *FaucetResponse) Equal(u *FaucetResponse) bool
func (*FaucetResponse) IsValid ¶
func (v *FaucetResponse) IsValid() error
func (*FaucetResponse) MarshalBinary ¶
func (v *FaucetResponse) MarshalBinary() ([]byte, error)
func (*FaucetResponse) MarshalJSON ¶
func (v *FaucetResponse) MarshalJSON() ([]byte, error)
func (*FaucetResponse) Type ¶
func (*FaucetResponse) Type() Type
func (*FaucetResponse) UnmarshalBinary ¶
func (v *FaucetResponse) UnmarshalBinary(data []byte) error
func (*FaucetResponse) UnmarshalBinaryFrom ¶
func (v *FaucetResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*FaucetResponse) UnmarshalFieldsFrom ¶
func (v *FaucetResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*FaucetResponse) UnmarshalJSON ¶
func (v *FaucetResponse) UnmarshalJSON(data []byte) error
type FindServiceRequest ¶
type FindServiceRequest struct { api.FindServiceOptions // contains filtered or unexported fields }
func (*FindServiceRequest) Copy ¶
func (v *FindServiceRequest) Copy() *FindServiceRequest
func (*FindServiceRequest) CopyAsInterface ¶
func (v *FindServiceRequest) CopyAsInterface() interface{}
func (*FindServiceRequest) Equal ¶
func (v *FindServiceRequest) Equal(u *FindServiceRequest) bool
func (*FindServiceRequest) IsValid ¶
func (v *FindServiceRequest) IsValid() error
func (*FindServiceRequest) MarshalBinary ¶
func (v *FindServiceRequest) MarshalBinary() ([]byte, error)
func (*FindServiceRequest) MarshalJSON ¶
func (v *FindServiceRequest) MarshalJSON() ([]byte, error)
func (*FindServiceRequest) Type ¶
func (*FindServiceRequest) Type() Type
func (*FindServiceRequest) UnmarshalBinary ¶
func (v *FindServiceRequest) UnmarshalBinary(data []byte) error
func (*FindServiceRequest) UnmarshalBinaryFrom ¶
func (v *FindServiceRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*FindServiceRequest) UnmarshalFieldsFrom ¶
func (v *FindServiceRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*FindServiceRequest) UnmarshalJSON ¶
func (v *FindServiceRequest) UnmarshalJSON(data []byte) error
type FindServiceResponse ¶
type FindServiceResponse struct { Value []*api.FindServiceResult `json:"value" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*FindServiceResponse) Copy ¶
func (v *FindServiceResponse) Copy() *FindServiceResponse
func (*FindServiceResponse) CopyAsInterface ¶
func (v *FindServiceResponse) CopyAsInterface() interface{}
func (*FindServiceResponse) Equal ¶
func (v *FindServiceResponse) Equal(u *FindServiceResponse) bool
func (*FindServiceResponse) IsValid ¶
func (v *FindServiceResponse) IsValid() error
func (*FindServiceResponse) MarshalBinary ¶
func (v *FindServiceResponse) MarshalBinary() ([]byte, error)
func (*FindServiceResponse) MarshalJSON ¶
func (v *FindServiceResponse) MarshalJSON() ([]byte, error)
func (*FindServiceResponse) Type ¶
func (*FindServiceResponse) Type() Type
func (*FindServiceResponse) UnmarshalBinary ¶
func (v *FindServiceResponse) UnmarshalBinary(data []byte) error
func (*FindServiceResponse) UnmarshalBinaryFrom ¶
func (v *FindServiceResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*FindServiceResponse) UnmarshalFieldsFrom ¶
func (v *FindServiceResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*FindServiceResponse) UnmarshalJSON ¶
func (v *FindServiceResponse) UnmarshalJSON(data []byte) error
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles message streams.
func NewHandler ¶
NewHandler constructs a new Handler with the given list of services. NewHandler only returns an error if more than one service attempts to register a method for the same request type.
type Message ¶
type Message interface { encoding.UnionValue Type() Type }
A Message is a binary message used to transport API v3 RPCs.
func UnmarshalFrom ¶
UnmarshalFrom unmarshals a Message.
func UnmarshalJSON ¶
UnmarshalJson unmarshals a Message.
type MetricsRequest ¶
type MetricsRequest struct { api.MetricsOptions // contains filtered or unexported fields }
func (*MetricsRequest) Copy ¶
func (v *MetricsRequest) Copy() *MetricsRequest
func (*MetricsRequest) CopyAsInterface ¶
func (v *MetricsRequest) CopyAsInterface() interface{}
func (*MetricsRequest) Equal ¶
func (v *MetricsRequest) Equal(u *MetricsRequest) bool
func (*MetricsRequest) IsValid ¶
func (v *MetricsRequest) IsValid() error
func (*MetricsRequest) MarshalBinary ¶
func (v *MetricsRequest) MarshalBinary() ([]byte, error)
func (*MetricsRequest) MarshalJSON ¶
func (v *MetricsRequest) MarshalJSON() ([]byte, error)
func (*MetricsRequest) Type ¶
func (*MetricsRequest) Type() Type
func (*MetricsRequest) UnmarshalBinary ¶
func (v *MetricsRequest) UnmarshalBinary(data []byte) error
func (*MetricsRequest) UnmarshalBinaryFrom ¶
func (v *MetricsRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*MetricsRequest) UnmarshalFieldsFrom ¶
func (v *MetricsRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*MetricsRequest) UnmarshalJSON ¶
func (v *MetricsRequest) UnmarshalJSON(data []byte) error
type MetricsResponse ¶
type MetricsResponse struct { Value *api.Metrics `json:"value,omitempty" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*MetricsResponse) Copy ¶
func (v *MetricsResponse) Copy() *MetricsResponse
func (*MetricsResponse) CopyAsInterface ¶
func (v *MetricsResponse) CopyAsInterface() interface{}
func (*MetricsResponse) Equal ¶
func (v *MetricsResponse) Equal(u *MetricsResponse) bool
func (*MetricsResponse) IsValid ¶
func (v *MetricsResponse) IsValid() error
func (*MetricsResponse) MarshalBinary ¶
func (v *MetricsResponse) MarshalBinary() ([]byte, error)
func (*MetricsResponse) MarshalJSON ¶
func (v *MetricsResponse) MarshalJSON() ([]byte, error)
func (*MetricsResponse) Type ¶
func (*MetricsResponse) Type() Type
func (*MetricsResponse) UnmarshalBinary ¶
func (v *MetricsResponse) UnmarshalBinary(data []byte) error
func (*MetricsResponse) UnmarshalBinaryFrom ¶
func (v *MetricsResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*MetricsResponse) UnmarshalFieldsFrom ¶
func (v *MetricsResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*MetricsResponse) UnmarshalJSON ¶
func (v *MetricsResponse) UnmarshalJSON(data []byte) error
type MetricsService ¶
type MetricsService struct {
api.MetricsService
}
MetricsService forwards [MetricsRequest]s to a api.MetricsService.
type MultiDialer ¶
type MultiDialer interface { Dialer // BadDial is used by Transport to report stream errors. The address will be // the same address passed to Dial, and the stream will be the exact value // returned from Dial. BadDial(context.Context, multiaddr.Multiaddr, Stream, error) bool }
MultiDialer is a dialer that accepts error reports and may be called multiple times for one request.
type NetworkService ¶
type NetworkService struct {
api.NetworkService
}
NetworkService forwards [NetworkStatusRequest]s to a api.NetworkService.
type NetworkStatusRequest ¶
type NetworkStatusRequest struct { api.NetworkStatusOptions // contains filtered or unexported fields }
func (*NetworkStatusRequest) Copy ¶
func (v *NetworkStatusRequest) Copy() *NetworkStatusRequest
func (*NetworkStatusRequest) CopyAsInterface ¶
func (v *NetworkStatusRequest) CopyAsInterface() interface{}
func (*NetworkStatusRequest) Equal ¶
func (v *NetworkStatusRequest) Equal(u *NetworkStatusRequest) bool
func (*NetworkStatusRequest) IsValid ¶
func (v *NetworkStatusRequest) IsValid() error
func (*NetworkStatusRequest) MarshalBinary ¶
func (v *NetworkStatusRequest) MarshalBinary() ([]byte, error)
func (*NetworkStatusRequest) MarshalJSON ¶
func (v *NetworkStatusRequest) MarshalJSON() ([]byte, error)
func (*NetworkStatusRequest) Type ¶
func (*NetworkStatusRequest) Type() Type
func (*NetworkStatusRequest) UnmarshalBinary ¶
func (v *NetworkStatusRequest) UnmarshalBinary(data []byte) error
func (*NetworkStatusRequest) UnmarshalBinaryFrom ¶
func (v *NetworkStatusRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*NetworkStatusRequest) UnmarshalFieldsFrom ¶
func (v *NetworkStatusRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*NetworkStatusRequest) UnmarshalJSON ¶
func (v *NetworkStatusRequest) UnmarshalJSON(data []byte) error
type NetworkStatusResponse ¶
type NetworkStatusResponse struct { Value *api.NetworkStatus `json:"value,omitempty" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*NetworkStatusResponse) Copy ¶
func (v *NetworkStatusResponse) Copy() *NetworkStatusResponse
func (*NetworkStatusResponse) CopyAsInterface ¶
func (v *NetworkStatusResponse) CopyAsInterface() interface{}
func (*NetworkStatusResponse) Equal ¶
func (v *NetworkStatusResponse) Equal(u *NetworkStatusResponse) bool
func (*NetworkStatusResponse) IsValid ¶
func (v *NetworkStatusResponse) IsValid() error
func (*NetworkStatusResponse) MarshalBinary ¶
func (v *NetworkStatusResponse) MarshalBinary() ([]byte, error)
func (*NetworkStatusResponse) MarshalJSON ¶
func (v *NetworkStatusResponse) MarshalJSON() ([]byte, error)
func (*NetworkStatusResponse) Type ¶
func (*NetworkStatusResponse) Type() Type
func (*NetworkStatusResponse) UnmarshalBinary ¶
func (v *NetworkStatusResponse) UnmarshalBinary(data []byte) error
func (*NetworkStatusResponse) UnmarshalBinaryFrom ¶
func (v *NetworkStatusResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*NetworkStatusResponse) UnmarshalFieldsFrom ¶
func (v *NetworkStatusResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*NetworkStatusResponse) UnmarshalJSON ¶
func (v *NetworkStatusResponse) UnmarshalJSON(data []byte) error
type NodeInfoRequest ¶
type NodeInfoRequest struct { api.NodeInfoOptions // contains filtered or unexported fields }
func (*NodeInfoRequest) Copy ¶
func (v *NodeInfoRequest) Copy() *NodeInfoRequest
func (*NodeInfoRequest) CopyAsInterface ¶
func (v *NodeInfoRequest) CopyAsInterface() interface{}
func (*NodeInfoRequest) Equal ¶
func (v *NodeInfoRequest) Equal(u *NodeInfoRequest) bool
func (*NodeInfoRequest) IsValid ¶
func (v *NodeInfoRequest) IsValid() error
func (*NodeInfoRequest) MarshalBinary ¶
func (v *NodeInfoRequest) MarshalBinary() ([]byte, error)
func (*NodeInfoRequest) MarshalJSON ¶
func (v *NodeInfoRequest) MarshalJSON() ([]byte, error)
func (*NodeInfoRequest) Type ¶
func (*NodeInfoRequest) Type() Type
func (*NodeInfoRequest) UnmarshalBinary ¶
func (v *NodeInfoRequest) UnmarshalBinary(data []byte) error
func (*NodeInfoRequest) UnmarshalBinaryFrom ¶
func (v *NodeInfoRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*NodeInfoRequest) UnmarshalFieldsFrom ¶
func (v *NodeInfoRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*NodeInfoRequest) UnmarshalJSON ¶
func (v *NodeInfoRequest) UnmarshalJSON(data []byte) error
type NodeInfoResponse ¶
type NodeInfoResponse struct { Value *api.NodeInfo `json:"value,omitempty" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*NodeInfoResponse) Copy ¶
func (v *NodeInfoResponse) Copy() *NodeInfoResponse
func (*NodeInfoResponse) CopyAsInterface ¶
func (v *NodeInfoResponse) CopyAsInterface() interface{}
func (*NodeInfoResponse) Equal ¶
func (v *NodeInfoResponse) Equal(u *NodeInfoResponse) bool
func (*NodeInfoResponse) IsValid ¶
func (v *NodeInfoResponse) IsValid() error
func (*NodeInfoResponse) MarshalBinary ¶
func (v *NodeInfoResponse) MarshalBinary() ([]byte, error)
func (*NodeInfoResponse) MarshalJSON ¶
func (v *NodeInfoResponse) MarshalJSON() ([]byte, error)
func (*NodeInfoResponse) Type ¶
func (*NodeInfoResponse) Type() Type
func (*NodeInfoResponse) UnmarshalBinary ¶
func (v *NodeInfoResponse) UnmarshalBinary(data []byte) error
func (*NodeInfoResponse) UnmarshalBinaryFrom ¶
func (v *NodeInfoResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*NodeInfoResponse) UnmarshalFieldsFrom ¶
func (v *NodeInfoResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*NodeInfoResponse) UnmarshalJSON ¶
func (v *NodeInfoResponse) UnmarshalJSON(data []byte) error
type NodeService ¶
type NodeService struct {
api.NodeService
}
NodeService forwards [NodeStatusRequest]s to a api.NodeService.
type PrivateClient ¶
type PrivateClient AddressedClient
PrivateClient is a binary message transport client for private API v3 services.
func (PrivateClient) Sequence ¶
func (c PrivateClient) Sequence(ctx context.Context, src, dst *url.URL, num uint64, opts private.SequenceOptions) (*api.MessageRecord[messaging.Message], error)
Sequence implements private.Sequencer.Sequence.
type PrivateSequenceRequest ¶
type PrivateSequenceRequest struct { Source *url.URL `json:"source,omitempty" form:"source" query:"source" validate:"required"` Destination *url.URL `json:"destination,omitempty" form:"destination" query:"destination" validate:"required"` SequenceNumber uint64 `json:"sequenceNumber,omitempty" form:"sequenceNumber" query:"sequenceNumber" validate:"required"` private.SequenceOptions // contains filtered or unexported fields }
func (*PrivateSequenceRequest) Copy ¶
func (v *PrivateSequenceRequest) Copy() *PrivateSequenceRequest
func (*PrivateSequenceRequest) CopyAsInterface ¶
func (v *PrivateSequenceRequest) CopyAsInterface() interface{}
func (*PrivateSequenceRequest) Equal ¶
func (v *PrivateSequenceRequest) Equal(u *PrivateSequenceRequest) bool
func (*PrivateSequenceRequest) IsValid ¶
func (v *PrivateSequenceRequest) IsValid() error
func (*PrivateSequenceRequest) MarshalBinary ¶
func (v *PrivateSequenceRequest) MarshalBinary() ([]byte, error)
func (*PrivateSequenceRequest) MarshalJSON ¶
func (v *PrivateSequenceRequest) MarshalJSON() ([]byte, error)
func (*PrivateSequenceRequest) Type ¶
func (*PrivateSequenceRequest) Type() Type
func (*PrivateSequenceRequest) UnmarshalBinary ¶
func (v *PrivateSequenceRequest) UnmarshalBinary(data []byte) error
func (*PrivateSequenceRequest) UnmarshalBinaryFrom ¶
func (v *PrivateSequenceRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*PrivateSequenceRequest) UnmarshalFieldsFrom ¶
func (v *PrivateSequenceRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*PrivateSequenceRequest) UnmarshalJSON ¶
func (v *PrivateSequenceRequest) UnmarshalJSON(data []byte) error
type PrivateSequenceResponse ¶
type PrivateSequenceResponse struct { Value *api.MessageRecord[messaging.Message] `json:"value,omitempty" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*PrivateSequenceResponse) Copy ¶
func (v *PrivateSequenceResponse) Copy() *PrivateSequenceResponse
func (*PrivateSequenceResponse) CopyAsInterface ¶
func (v *PrivateSequenceResponse) CopyAsInterface() interface{}
func (*PrivateSequenceResponse) Equal ¶
func (v *PrivateSequenceResponse) Equal(u *PrivateSequenceResponse) bool
func (*PrivateSequenceResponse) IsValid ¶
func (v *PrivateSequenceResponse) IsValid() error
func (*PrivateSequenceResponse) MarshalBinary ¶
func (v *PrivateSequenceResponse) MarshalBinary() ([]byte, error)
func (*PrivateSequenceResponse) MarshalJSON ¶
func (v *PrivateSequenceResponse) MarshalJSON() ([]byte, error)
func (*PrivateSequenceResponse) Type ¶
func (*PrivateSequenceResponse) Type() Type
func (*PrivateSequenceResponse) UnmarshalBinary ¶
func (v *PrivateSequenceResponse) UnmarshalBinary(data []byte) error
func (*PrivateSequenceResponse) UnmarshalBinaryFrom ¶
func (v *PrivateSequenceResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*PrivateSequenceResponse) UnmarshalFieldsFrom ¶
func (v *PrivateSequenceResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*PrivateSequenceResponse) UnmarshalJSON ¶
func (v *PrivateSequenceResponse) UnmarshalJSON(data []byte) error
type Querier ¶
type Querier struct {
api.Querier
}
Querier forwards [QueryRequest]s to a api.Querier.
type QueryRequest ¶
type QueryRequest struct { Scope *url.URL `json:"scope,omitempty" form:"scope" query:"scope" validate:"required"` Query api.Query `json:"query,omitempty" form:"query" query:"query"` // contains filtered or unexported fields }
func (*QueryRequest) Copy ¶
func (v *QueryRequest) Copy() *QueryRequest
func (*QueryRequest) CopyAsInterface ¶
func (v *QueryRequest) CopyAsInterface() interface{}
func (*QueryRequest) Equal ¶
func (v *QueryRequest) Equal(u *QueryRequest) bool
func (*QueryRequest) IsValid ¶
func (v *QueryRequest) IsValid() error
func (*QueryRequest) MarshalBinary ¶
func (v *QueryRequest) MarshalBinary() ([]byte, error)
func (*QueryRequest) MarshalJSON ¶
func (v *QueryRequest) MarshalJSON() ([]byte, error)
func (*QueryRequest) Type ¶
func (*QueryRequest) Type() Type
func (*QueryRequest) UnmarshalBinary ¶
func (v *QueryRequest) UnmarshalBinary(data []byte) error
func (*QueryRequest) UnmarshalBinaryFrom ¶
func (v *QueryRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*QueryRequest) UnmarshalFieldsFrom ¶
func (v *QueryRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*QueryRequest) UnmarshalJSON ¶
func (v *QueryRequest) UnmarshalJSON(data []byte) error
type RecordResponse ¶
type RecordResponse struct { Value api.Record `json:"value,omitempty" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*RecordResponse) Copy ¶
func (v *RecordResponse) Copy() *RecordResponse
func (*RecordResponse) CopyAsInterface ¶
func (v *RecordResponse) CopyAsInterface() interface{}
func (*RecordResponse) Equal ¶
func (v *RecordResponse) Equal(u *RecordResponse) bool
func (*RecordResponse) IsValid ¶
func (v *RecordResponse) IsValid() error
func (*RecordResponse) MarshalBinary ¶
func (v *RecordResponse) MarshalBinary() ([]byte, error)
func (*RecordResponse) MarshalJSON ¶
func (v *RecordResponse) MarshalJSON() ([]byte, error)
func (*RecordResponse) Type ¶
func (*RecordResponse) Type() Type
func (*RecordResponse) UnmarshalBinary ¶
func (v *RecordResponse) UnmarshalBinary(data []byte) error
func (*RecordResponse) UnmarshalBinaryFrom ¶
func (v *RecordResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*RecordResponse) UnmarshalFieldsFrom ¶
func (v *RecordResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*RecordResponse) UnmarshalJSON ¶
func (v *RecordResponse) UnmarshalJSON(data []byte) error
type ResponseCallback ¶
type RoutedTransport ¶
type RoutedTransport struct { // Network to query. Some queries are only available when a network is // specified. Network string // Dialer dials connections to a given address. The client indicates that // the stream can be closed by canceling the context passed to Dial. Dialer Dialer // Router determines the address a message should be routed to. Router Router // Attempts is the number of connection attempts to make. Attempts int // Debug prints round trip requests to stderr. Debug bool }
RoutedTransport is a Transport implementation that routes messages to the appropriate service.
func (*RoutedTransport) OpenStream ¶
func (c *RoutedTransport) OpenStream(ctx context.Context, request Message, callback ResponseCallback) (Stream, error)
func (*RoutedTransport) RoundTrip ¶
func (c *RoutedTransport) RoundTrip(ctx context.Context, requests []Message, callback ResponseCallback) error
RoundTrip routes each requests and executes a round-trip call. If there are no transport errors, RoundTrip will only dial each address once. If multiple requests route to the same address, the first request will dial a stream and subsequent requests to that address will reuse the existing stream.
Certain types of requests, such as transaction hash searches, are fanned out to every partition. If requests contains such a request, RoundTrip queries the network for a list of partitions, submits the request to every partition, and aggregates the responses into a single response.
RoundTrip is a low-level interface not intended for general use.
roundTrip routes each request, dials a stream, and executes a round-trip call, sending the request and waiting for the response. roundTrip calls the callback for each request-response pair. The callback may be called more than once if there are transport errors.
roundTrip maintains a stream dictionary, which is passed to dial. Since dial will reuse an existing stream when appropriate, if there are no transport errors, roundTrip will only dial each address once. If multiple requests route to the same address, the first request will dial a stream and subsequent requests to that address will reuse the existing stream.
type Sequencer ¶
Sequencer forwards [PrivateSequenceRequest]s to a private.Sequencer.
type Service ¶
type Service interface {
// contains filtered or unexported methods
}
A Service is implements binary message transport for an API v3 service.
type Stream ¶
Stream is a stream of [Message]s.
func NewStream ¶
func NewStream(raw io.ReadWriter) Stream
NewStream returns a Stream of [Message]s wrapping the underlying io.ReadWriter.
Messages are marshalled and unmarshalled as binary prefixed with the byte count.
type StreamOf ¶
type StreamOf[T any] interface { // Read reads the next value from the stream. Read() (T, error) // Write writes a value to the stream. Write(T) error }
Stream is a stream of T.
func NewStreamOf ¶
func NewStreamOf[T any, PT valuePtr[T]](raw io.ReadWriter) StreamOf[PT]
NewStreamOf returns a [StreamOf[T]] wrapping the underlying io.ReadWriter. A pointer to T must implement encoding.BinaryValue.
Values are marshalled and unmarshalled as binary prefixed with the byte count.
type SubmitRequest ¶
type SubmitRequest struct { Envelope *messaging.Envelope `json:"envelope,omitempty" form:"envelope" query:"envelope" validate:"required"` api.SubmitOptions // contains filtered or unexported fields }
func (*SubmitRequest) Copy ¶
func (v *SubmitRequest) Copy() *SubmitRequest
func (*SubmitRequest) CopyAsInterface ¶
func (v *SubmitRequest) CopyAsInterface() interface{}
func (*SubmitRequest) Equal ¶
func (v *SubmitRequest) Equal(u *SubmitRequest) bool
func (*SubmitRequest) IsValid ¶
func (v *SubmitRequest) IsValid() error
func (*SubmitRequest) MarshalBinary ¶
func (v *SubmitRequest) MarshalBinary() ([]byte, error)
func (*SubmitRequest) MarshalJSON ¶
func (v *SubmitRequest) MarshalJSON() ([]byte, error)
func (*SubmitRequest) Type ¶
func (*SubmitRequest) Type() Type
func (*SubmitRequest) UnmarshalBinary ¶
func (v *SubmitRequest) UnmarshalBinary(data []byte) error
func (*SubmitRequest) UnmarshalBinaryFrom ¶
func (v *SubmitRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*SubmitRequest) UnmarshalFieldsFrom ¶
func (v *SubmitRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*SubmitRequest) UnmarshalJSON ¶
func (v *SubmitRequest) UnmarshalJSON(data []byte) error
type SubmitResponse ¶
type SubmitResponse struct { Value []*api.Submission `json:"value" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*SubmitResponse) Copy ¶
func (v *SubmitResponse) Copy() *SubmitResponse
func (*SubmitResponse) CopyAsInterface ¶
func (v *SubmitResponse) CopyAsInterface() interface{}
func (*SubmitResponse) Equal ¶
func (v *SubmitResponse) Equal(u *SubmitResponse) bool
func (*SubmitResponse) IsValid ¶
func (v *SubmitResponse) IsValid() error
func (*SubmitResponse) MarshalBinary ¶
func (v *SubmitResponse) MarshalBinary() ([]byte, error)
func (*SubmitResponse) MarshalJSON ¶
func (v *SubmitResponse) MarshalJSON() ([]byte, error)
func (*SubmitResponse) Type ¶
func (*SubmitResponse) Type() Type
func (*SubmitResponse) UnmarshalBinary ¶
func (v *SubmitResponse) UnmarshalBinary(data []byte) error
func (*SubmitResponse) UnmarshalBinaryFrom ¶
func (v *SubmitResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*SubmitResponse) UnmarshalFieldsFrom ¶
func (v *SubmitResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*SubmitResponse) UnmarshalJSON ¶
func (v *SubmitResponse) UnmarshalJSON(data []byte) error
type Submitter ¶
type Submitter struct {
api.Submitter
}
Submitter forwards [SubmitRequest]s to a api.Submitter.
type SubscribeRequest ¶
type SubscribeRequest struct { api.SubscribeOptions // contains filtered or unexported fields }
func (*SubscribeRequest) Copy ¶
func (v *SubscribeRequest) Copy() *SubscribeRequest
func (*SubscribeRequest) CopyAsInterface ¶
func (v *SubscribeRequest) CopyAsInterface() interface{}
func (*SubscribeRequest) Equal ¶
func (v *SubscribeRequest) Equal(u *SubscribeRequest) bool
func (*SubscribeRequest) IsValid ¶
func (v *SubscribeRequest) IsValid() error
func (*SubscribeRequest) MarshalBinary ¶
func (v *SubscribeRequest) MarshalBinary() ([]byte, error)
func (*SubscribeRequest) MarshalJSON ¶
func (v *SubscribeRequest) MarshalJSON() ([]byte, error)
func (*SubscribeRequest) Type ¶
func (*SubscribeRequest) Type() Type
func (*SubscribeRequest) UnmarshalBinary ¶
func (v *SubscribeRequest) UnmarshalBinary(data []byte) error
func (*SubscribeRequest) UnmarshalBinaryFrom ¶
func (v *SubscribeRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*SubscribeRequest) UnmarshalFieldsFrom ¶
func (v *SubscribeRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*SubscribeRequest) UnmarshalJSON ¶
func (v *SubscribeRequest) UnmarshalJSON(data []byte) error
type SubscribeResponse ¶
type SubscribeResponse struct {
// contains filtered or unexported fields
}
func (*SubscribeResponse) Copy ¶
func (v *SubscribeResponse) Copy() *SubscribeResponse
func (*SubscribeResponse) CopyAsInterface ¶
func (v *SubscribeResponse) CopyAsInterface() interface{}
func (*SubscribeResponse) Equal ¶
func (v *SubscribeResponse) Equal(u *SubscribeResponse) bool
func (*SubscribeResponse) IsValid ¶
func (v *SubscribeResponse) IsValid() error
func (*SubscribeResponse) MarshalBinary ¶
func (v *SubscribeResponse) MarshalBinary() ([]byte, error)
func (*SubscribeResponse) MarshalJSON ¶
func (v *SubscribeResponse) MarshalJSON() ([]byte, error)
func (*SubscribeResponse) Type ¶
func (*SubscribeResponse) Type() Type
func (*SubscribeResponse) UnmarshalBinary ¶
func (v *SubscribeResponse) UnmarshalBinary(data []byte) error
func (*SubscribeResponse) UnmarshalBinaryFrom ¶
func (v *SubscribeResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*SubscribeResponse) UnmarshalFieldsFrom ¶
func (v *SubscribeResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*SubscribeResponse) UnmarshalJSON ¶
func (v *SubscribeResponse) UnmarshalJSON(data []byte) error
type Transport ¶
type Transport interface { // RoundTrip opens one or more streams to nodes that can serve the requests // and processes a request-response round trip on a stream for each request. RoundTrip(ctx context.Context, requests []Message, callback ResponseCallback) error // OpenStream opens a stream to a node that can serve the request, processes // a request-response round trip on the stream, and returns the open stream. // // If a batch has been opened for the context, multiple calls to OpenStream // (with that context) will return the same Stream. Depending on the service // it may not be safe to reuse streams in this way. // // If a batch has _not_ been opened for the context, it is the // responsibility of the caller to close the stream or cancel the context. OpenStream(ctx context.Context, request Message, callback ResponseCallback) (Stream, error) }
Transport is a binary message transport implementation.
type Type ¶
type Type int
Type is the type of a Message.
const TypeAddressed Type = 255
TypeAddressed .
const TypeConsensusStatusRequest Type = 3
TypeConsensusStatusRequest .
const TypeConsensusStatusResponse Type = 35
TypeConsensusStatusResponse .
const TypeErrorResponse Type = 32
TypeErrorResponse .
const TypeEvent Type = 64
TypeEvent .
const TypeFaucetRequest Type = 10
TypeFaucetRequest .
const TypeFaucetResponse Type = 42
TypeFaucetResponse .
const TypeFindServiceRequest Type = 2
TypeFindServiceRequest .
const TypeFindServiceResponse Type = 34
TypeFindServiceResponse .
const TypeMetricsRequest Type = 5
TypeMetricsRequest .
const TypeMetricsResponse Type = 37
TypeMetricsResponse .
const TypeNetworkStatusRequest Type = 4
TypeNetworkStatusRequest .
const TypeNetworkStatusResponse Type = 36
TypeNetworkStatusResponse .
const TypeNodeInfoRequest Type = 1
TypeNodeInfoRequest .
const TypeNodeInfoResponse Type = 33
TypeNodeInfoResponse .
const TypePrivateSequenceRequest Type = 128
TypePrivateSequenceRequest .
const TypePrivateSequenceResponse Type = 129
TypePrivateSequenceResponse .
const TypeQueryRequest Type = 6
TypeQueryRequest .
const TypeRecordResponse Type = 38
TypeRecordResponse .
const TypeSubmitRequest Type = 7
TypeSubmitRequest .
const TypeSubmitResponse Type = 39
TypeSubmitResponse .
const TypeSubscribeRequest Type = 9
TypeSubscribeRequest .
const TypeSubscribeResponse Type = 41
TypeSubscribeResponse .
const TypeValidateRequest Type = 8
TypeValidateRequest .
const TypeValidateResponse Type = 40
TypeValidateResponse .
func (Type) GetEnumValue ¶
GetEnumValue returns the value of the Type
func (Type) MarshalJSON ¶
MarshalJSON marshals the Type to JSON as a string.
func (*Type) SetEnumValue ¶
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (*Type) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Type from JSON as a string.
type ValidateRequest ¶
type ValidateRequest struct { Envelope *messaging.Envelope `json:"envelope,omitempty" form:"envelope" query:"envelope" validate:"required"` api.ValidateOptions // contains filtered or unexported fields }
func (*ValidateRequest) Copy ¶
func (v *ValidateRequest) Copy() *ValidateRequest
func (*ValidateRequest) CopyAsInterface ¶
func (v *ValidateRequest) CopyAsInterface() interface{}
func (*ValidateRequest) Equal ¶
func (v *ValidateRequest) Equal(u *ValidateRequest) bool
func (*ValidateRequest) IsValid ¶
func (v *ValidateRequest) IsValid() error
func (*ValidateRequest) MarshalBinary ¶
func (v *ValidateRequest) MarshalBinary() ([]byte, error)
func (*ValidateRequest) MarshalJSON ¶
func (v *ValidateRequest) MarshalJSON() ([]byte, error)
func (*ValidateRequest) Type ¶
func (*ValidateRequest) Type() Type
func (*ValidateRequest) UnmarshalBinary ¶
func (v *ValidateRequest) UnmarshalBinary(data []byte) error
func (*ValidateRequest) UnmarshalBinaryFrom ¶
func (v *ValidateRequest) UnmarshalBinaryFrom(rd io.Reader) error
func (*ValidateRequest) UnmarshalFieldsFrom ¶
func (v *ValidateRequest) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*ValidateRequest) UnmarshalJSON ¶
func (v *ValidateRequest) UnmarshalJSON(data []byte) error
type ValidateResponse ¶
type ValidateResponse struct { Value []*api.Submission `json:"value" form:"value" query:"value" validate:"required"` // contains filtered or unexported fields }
func (*ValidateResponse) Copy ¶
func (v *ValidateResponse) Copy() *ValidateResponse
func (*ValidateResponse) CopyAsInterface ¶
func (v *ValidateResponse) CopyAsInterface() interface{}
func (*ValidateResponse) Equal ¶
func (v *ValidateResponse) Equal(u *ValidateResponse) bool
func (*ValidateResponse) IsValid ¶
func (v *ValidateResponse) IsValid() error
func (*ValidateResponse) MarshalBinary ¶
func (v *ValidateResponse) MarshalBinary() ([]byte, error)
func (*ValidateResponse) MarshalJSON ¶
func (v *ValidateResponse) MarshalJSON() ([]byte, error)
func (*ValidateResponse) Type ¶
func (*ValidateResponse) Type() Type
func (*ValidateResponse) UnmarshalBinary ¶
func (v *ValidateResponse) UnmarshalBinary(data []byte) error
func (*ValidateResponse) UnmarshalBinaryFrom ¶
func (v *ValidateResponse) UnmarshalBinaryFrom(rd io.Reader) error
func (*ValidateResponse) UnmarshalFieldsFrom ¶
func (v *ValidateResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error
func (*ValidateResponse) UnmarshalJSON ¶
func (v *ValidateResponse) UnmarshalJSON(data []byte) error
type Validator ¶
type Validator struct {
api.Validator
}
Validator forwards [ValidateRequest]s to a api.Validator.