config

package
v0.0.0-...-dcdbaa1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package config provides a method by which dependencies can be injected into dependency chains, via the use of SupplierFn functions. These functions return functions that can be used in CLI code to chain the dependencies required to start a service into a single depinject.Config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupplyConfig

func SupplyConfig(
	ctx context.Context,
	cmd *cobra.Command,
	suppliers []SupplierFn,
) (deps depinject.Config, err error)

SupplyConfig supplies a depinject config by calling each of the supplied supplier functions in order and passing the result of each supplier to the next supplier, chaining them together.

Types

type SupplierFn

type SupplierFn func(
	context.Context,
	depinject.Config,
	*cobra.Command,
) (depinject.Config, error)

SupplierFn is a function that is used to supply a depinject config.

func NewSupplyAccountQuerierFn

func NewSupplyAccountQuerierFn() SupplierFn

NewSupplyAccountQuerierFn supplies a depinject config with an AccountQuerier.

func NewSupplyApplicationQuerierFn

func NewSupplyApplicationQuerierFn() SupplierFn

NewSupplyApplicationQuerierFn supplies a depinject config with an ApplicationQuerier.

func NewSupplyBlockClientFn

func NewSupplyBlockClientFn(queryNodeRPCURL *url.URL) SupplierFn

NewSupplyBlockClientFn supplies a depinject config with a blockClient.

func NewSupplyDelegationClientFn

func NewSupplyDelegationClientFn() SupplierFn

NewSupplyDelegationClientFn returns a function which constructs a DelegationClient instance and returns a new depinject.Config which is supplied with the given deps and the new DelegationClient.

func NewSupplyEventsQueryClientFn

func NewSupplyEventsQueryClientFn(queryNodeRPCURL *url.URL) SupplierFn

NewSupplyEventsQueryClientFn supplies a depinject config with an EventsQueryClient from the given queryNodeRPCURL.

func NewSupplyLoggerFromCtx

func NewSupplyLoggerFromCtx(ctx context.Context) SupplierFn

NewSupplyLoggerFromCtx supplies a depinject config with a polylog.Logger instance populated from the given context.

func NewSupplyPOKTRollSDKFn

func NewSupplyPOKTRollSDKFn(signingKeyName string) SupplierFn

NewSupplyPOKTRollSDKFn supplies a depinject config with a POKTRollSDK given the signing key name.

func NewSupplyQueryClientContextFn

func NewSupplyQueryClientContextFn(queryNodeGRPCURL *url.URL) SupplierFn

NewSupplyQueryClientContextFn supplies a depinject config with a query

ClientContext, a GRPC client connection, and a keyring from the given queryNodeGRPCURL.

func NewSupplyRingCacheFn

func NewSupplyRingCacheFn() SupplierFn

NewSupplyRingCacheFn supplies a depinject config with a RingCache.

func NewSupplySessionQuerierFn

func NewSupplySessionQuerierFn() SupplierFn

NewSupplySessionQuerierFn supplies a depinject config with a SessionQuerier.

func NewSupplySupplierQuerierFn

func NewSupplySupplierQuerierFn() SupplierFn

NewSupplySupplierQuerierFn supplies a depinject config with a SupplierQuerier.

func NewSupplyTxClientContextFn

func NewSupplyTxClientContextFn(
	queryNodeGRPCURL *url.URL,
	txNodeRPCURL *url.URL,
) SupplierFn

NewSupplyTxClientContextFn supplies a depinject config with a TxClientContext from the given txNodeGRPCURL. TODO_TECHDEBT(#256): Remove this function once the as we may no longer need to supply a TxClientContext to the RelayMiner.

Jump to

Keyboard shortcuts

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