client

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultClientMetrics added in v0.4.0

func DefaultClientMetrics(namespace string) *grpc_prometheus.ClientMetrics

func NewConnection

func NewConnection(
	target string,
	opts ...Option,
) (*grpc.ClientConn, error)

Types

type Client

type Client interface {
	GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.BlockHeader, error)
	ExecuteScriptAtBlockHeight(ctx context.Context, height uint64, script []byte, arguments []cadence.Value) (cadence.Value, error)
	GetBlockByHeight(ctx context.Context, height uint64) (*flow.Block, error)
	GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.Transaction, error)
	GetEventsForHeightRange(ctx context.Context, query flowgrpc.EventRangeQuery) ([]flow.BlockEvents, error)
	GetCollection(ctx context.Context, colID flow.Identifier) (*flow.Collection, error)
}

func NewClientFromConnection

func NewClientFromConnection(
	conn grpc.ClientConnInterface,
) Client

type ClosableClient

type ClosableClient interface {
	Client
	io.Closer
}

func NewClient

func NewClient(
	target string,
	opts ...Option,
) (ClosableClient, error)

type Config added in v0.4.0

type Config struct {
	Log zerolog.Logger

	DefaultCallOptions []grpc.CallOption

	DefaultRateLimit   int
	SpecificRateLimits map[string]int

	Timeout time.Duration

	Retries int

	ClientMetrics *grpc_prometheus.ClientMetrics
	// contains filtered or unexported fields
}

func DefaultConfig added in v0.4.0

func DefaultConfig() Config

func (Config) Interceptors added in v0.4.0

func (c Config) Interceptors() []grpc.UnaryClientInterceptor

type Option added in v0.4.0

type Option func(*Config)

func WithLog added in v0.4.0

func WithLog(log zerolog.Logger) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL