http

package
v0.9.28 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockAndTxs added in v0.9.25

type BlockAndTxs struct {
	Blocks       []structs.BlockWithMeta       `json:"blocks"`
	Transactions []structs.TransactionWithMeta `json:"transactions"`
}

type HTTPStore

type HTTPStore struct {
	// contains filtered or unexported fields
}

func NewHTTPStore

func NewHTTPStore(storeTypeURLs HTTPStoreTypeURLs, cli *http.Client) (*HTTPStore, error)

NewHTTPStore constructs a new HTTPStore for any provided storage types. Each storage type must contain at least 1 url.

func NewHTTPStoreRewards added in v0.5.0

func NewHTTPStoreRewards(rewardsUrls []string, cli *http.Client) (*HTTPStore, error)

NewHTTPStoreRewards creates a new HTTPStore only with rewards urls. URL list must not be empty.

func NewHTTPStoreSearch added in v0.5.0

func NewHTTPStoreSearch(searchUrls []string, cli *http.Client) (*HTTPStore, error)

NewHTTPStoreSearch creates a new HTTPStore only with search urls. URL list must not be empty.

func NewHTTPStoreValidators added in v0.8.0

func NewHTTPStoreValidators(validatorsURLs []string, cli *http.Client) (*HTTPStore, error)

NewHTTPStoreValidators creates a new HTTPStore only with vaidators urls. URL list must not be empty.

func (*HTTPStore) GetRewardsSession

func (s *HTTPStore) GetRewardsSession(ctx context.Context) (store.RewardStore, error)

func (*HTTPStore) GetSearchSession

func (s *HTTPStore) GetSearchSession(ctx context.Context) (store.SearchStore, error)

func (*HTTPStore) GetValidatorsSession added in v0.8.0

func (s *HTTPStore) GetValidatorsSession(ctx context.Context) (store.ValidatorStore, error)

type HTTPStoreSession

type HTTPStoreSession struct {
	// contains filtered or unexported fields
}

HTTPStoreSession contains common logic for Store structs (SearchStore and RewardStore).

type HTTPStoreType added in v0.8.0

type HTTPStoreType int
const (
	StoreTypeSearch HTTPStoreType = iota
	StoreTypeRewards
	StoreTypeValidators
)

Make sure that you make an entry in `storeTypeStrings` below if you are adding a new HTTPStoreType.

func (HTTPStoreType) String added in v0.8.0

func (st HTTPStoreType) String() string

type HTTPStoreTypeURLs added in v0.8.0

type HTTPStoreTypeURLs map[HTTPStoreType][]string

type JsonRPCError

type JsonRPCError struct {
	Code    int64         `json:"code"`
	Message string        `json:"message"`
	Data    []interface{} `json:"data"`
}

type JsonRPCResponse

type JsonRPCResponse struct {
	ID      uint64          `json:"id"`
	JSONRPC string          `json:"jsonrpc"`
	Error   *JsonRPCError   `json:"error,omitempty"`
	Result  json.RawMessage `json:"result"`
}

type RewardStore

type RewardStore struct {
	*HTTPStoreSession
}

func (*RewardStore) Close added in v0.9.14

func (s *RewardStore) Close(ctx context.Context) error

func (*RewardStore) StoreClaimedReward added in v0.9.14

func (s *RewardStore) StoreClaimedReward(ctx context.Context, reward structs.ClaimedReward) error

func (*RewardStore) StoreClaimedRewards

func (s *RewardStore) StoreClaimedRewards(ctx context.Context, rewards []structs.ClaimedReward) error

func (*RewardStore) StoreEarnedReward added in v0.9.14

func (s *RewardStore) StoreEarnedReward(ctx context.Context, reward structs.EarnedReward) error

func (*RewardStore) StoreEarnedRewards added in v0.9.14

func (s *RewardStore) StoreEarnedRewards(ctx context.Context, rewards []structs.EarnedReward) error

func (*RewardStore) StoreUnclaimedReward added in v0.9.14

func (s *RewardStore) StoreUnclaimedReward(ctx context.Context, reward structs.UnclaimedReward) error

func (*RewardStore) StoreUnclaimedRewards

func (s *RewardStore) StoreUnclaimedRewards(ctx context.Context, rewards []structs.UnclaimedReward) error

type SearchStore

type SearchStore struct {
	*HTTPStoreSession
}

func (*SearchStore) Close added in v0.9.14

func (s *SearchStore) Close(ctx context.Context) error

func (*SearchStore) ConfirmHeights

func (s *SearchStore) ConfirmHeights(ctx context.Context, heights []structs.BlockWithMeta) error

func (*SearchStore) SearchBlockAtTime added in v0.7.1

func (s *SearchStore) SearchBlockAtTime(ctx context.Context, timeAccount structs.TimeAccount) (*structs.Block, error)

func (*SearchStore) StoreBlocks

func (s *SearchStore) StoreBlocks(ctx context.Context, blocks []structs.BlockWithMeta) error

func (*SearchStore) StoreBlocksAndTransactionsBinary added in v0.9.25

func (s *SearchStore) StoreBlocksAndTransactionsBinary(ctx context.Context, blocks []structs.BlockWithMeta, txs []structs.TransactionWithMeta) error

func (*SearchStore) StoreTransactions

func (s *SearchStore) StoreTransactions(ctx context.Context, txs []structs.TransactionWithMeta) error

type ValidatorStore added in v0.8.0

type ValidatorStore struct {
	*HTTPStoreSession
}

func (*ValidatorStore) Close added in v0.9.14

func (s *ValidatorStore) Close(ctx context.Context) error

func (*ValidatorStore) StoreValidatorPerfMetrics added in v0.9.2

func (s *ValidatorStore) StoreValidatorPerfMetrics(
	ctx context.Context,
	perfMetrics []structs.ValidatorPerfMetric,
) error

func (*ValidatorStore) StoreValidatorStatuses added in v0.8.0

func (s *ValidatorStore) StoreValidatorStatuses(ctx context.Context, statuses []structs.ValidatorStatus) error

Jump to

Keyboard shortcuts

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