Documentation ¶
Index ¶
- Variables
- type CoreClient
- type ErrorCode
- type InsecureGRPCClient
- func (c *InsecureGRPCClient) CheckTransaction(ctx context.Context, req *apipb.CheckTransactionRequest, ...) (*apipb.CheckTransactionResponse, error)
- func (c *InsecureGRPCClient) GetVegaTime(ctx context.Context, req *apipb.GetVegaTimeRequest, opts ...grpc.CallOption) (*apipb.GetVegaTimeResponse, error)
- func (c *InsecureGRPCClient) Host() string
- func (c *InsecureGRPCClient) LastBlockHeight(ctx context.Context, req *apipb.LastBlockHeightRequest, ...) (*apipb.LastBlockHeightResponse, error)
- func (c *InsecureGRPCClient) Stop() error
- func (c *InsecureGRPCClient) SubmitTransaction(ctx context.Context, req *apipb.SubmitTransactionRequest, ...) (*apipb.SubmitTransactionResponse, error)
- type RetryingGRPCNode
- func (n *RetryingGRPCNode) CheckTransaction(ctx context.Context, tx *commandspb.Transaction) (*apipb.CheckTransactionResponse, error)
- func (n *RetryingGRPCNode) HealthCheck(ctx context.Context) error
- func (n *RetryingGRPCNode) Host() string
- func (n *RetryingGRPCNode) LastBlock(ctx context.Context) (*apipb.LastBlockHeightResponse, error)
- func (n *RetryingGRPCNode) SendTransaction(ctx context.Context, tx *commandspb.Transaction, ...) (string, error)
- func (n *RetryingGRPCNode) Stop() error
- type RoundRobinSelector
- type StatusError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoNodeConfigured = errors.New("no node configured on round-robin selector") ErrNoHealthyNodeAvailable = errors.New("no healthy node available") )
Functions ¶
This section is empty.
Types ¶
type CoreClient ¶
type CoreClient interface { Host() string SubmitTransaction(ctx context.Context, in *apipb.SubmitTransactionRequest, opts ...grpc.CallOption) (*apipb.SubmitTransactionResponse, error) LastBlockHeight(ctx context.Context, in *apipb.LastBlockHeightRequest, opts ...grpc.CallOption) (*apipb.LastBlockHeightResponse, error) GetVegaTime(ctx context.Context, in *apipb.GetVegaTimeRequest, opts ...grpc.CallOption) (*apipb.GetVegaTimeResponse, error) CheckTransaction(ctx context.Context, in *apipb.CheckTransactionRequest, opts ...grpc.CallOption) (*apipb.CheckTransactionResponse, error) Stop() error }
type InsecureGRPCClient ¶
type InsecureGRPCClient struct {
// contains filtered or unexported fields
}
func NewInsecureGRPCClient ¶
func NewInsecureGRPCClient(host string) (*InsecureGRPCClient, error)
func (*InsecureGRPCClient) CheckTransaction ¶
func (c *InsecureGRPCClient) CheckTransaction(ctx context.Context, req *apipb.CheckTransactionRequest, opts ...grpc.CallOption) (*apipb.CheckTransactionResponse, error)
func (*InsecureGRPCClient) GetVegaTime ¶
func (c *InsecureGRPCClient) GetVegaTime(ctx context.Context, req *apipb.GetVegaTimeRequest, opts ...grpc.CallOption) (*apipb.GetVegaTimeResponse, error)
func (*InsecureGRPCClient) Host ¶
func (c *InsecureGRPCClient) Host() string
func (*InsecureGRPCClient) LastBlockHeight ¶
func (c *InsecureGRPCClient) LastBlockHeight(ctx context.Context, req *apipb.LastBlockHeightRequest, opts ...grpc.CallOption) (*apipb.LastBlockHeightResponse, error)
func (*InsecureGRPCClient) Stop ¶
func (c *InsecureGRPCClient) Stop() error
func (*InsecureGRPCClient) SubmitTransaction ¶
func (c *InsecureGRPCClient) SubmitTransaction(ctx context.Context, req *apipb.SubmitTransactionRequest, opts ...grpc.CallOption) (*apipb.SubmitTransactionResponse, error)
type RetryingGRPCNode ¶
type RetryingGRPCNode struct {
// contains filtered or unexported fields
}
func BuildGRPCNode ¶
func BuildGRPCNode(log *zap.Logger, client CoreClient, retries uint64) *RetryingGRPCNode
func NewGRPCNode ¶
func (*RetryingGRPCNode) CheckTransaction ¶
func (n *RetryingGRPCNode) CheckTransaction(ctx context.Context, tx *commandspb.Transaction) (*apipb.CheckTransactionResponse, error)
func (*RetryingGRPCNode) HealthCheck ¶
func (n *RetryingGRPCNode) HealthCheck(ctx context.Context) error
func (*RetryingGRPCNode) Host ¶
func (n *RetryingGRPCNode) Host() string
func (*RetryingGRPCNode) LastBlock ¶
func (n *RetryingGRPCNode) LastBlock(ctx context.Context) (*apipb.LastBlockHeightResponse, error)
LastBlock returns information about the last block acknowledged by the node.
func (*RetryingGRPCNode) SendTransaction ¶
func (n *RetryingGRPCNode) SendTransaction(ctx context.Context, tx *commandspb.Transaction, ty apipb.SubmitTransactionRequest_Type) (string, error)
func (*RetryingGRPCNode) Stop ¶
func (n *RetryingGRPCNode) Stop() error
type RoundRobinSelector ¶
type RoundRobinSelector struct {
// contains filtered or unexported fields
}
RoundRobinSelector uses a classic round-robin algorithm to select a node. When requesting the next node, this is the node right behind the current one that is selected. When the last node is reached, it starts over the first one.
func NewRoundRobinSelector ¶
func (*RoundRobinSelector) Stop ¶
func (ns *RoundRobinSelector) Stop()
Stop stops all the registered nodes. If a node raises an error during closing, the selector ignores it and carry on a best-effort.
type StatusError ¶
func (*StatusError) Error ¶
func (e *StatusError) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.