elastic

package
v0.0.0-...-1340fc4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlockHash

func GetBlockHash(elasticURL, blockIndexName, organization, peerName, channelId string, blockNumber uint64) (string, error)

Returns the hash of the specified block from the specified index.

func SendBlockNumber

func SendBlockNumber(url string, lastBlockNumber BlockNumber) error

Types

type BlockIndexFilterResponse

type BlockIndexFilterResponse struct {
	BlockIndexFilterHitsObject struct {
		BlockIndexFilterHit []struct {
			BlockIndexData struct {
				BlockHash string `json:"block_hash"`
			} `json:"_source"`
		} `json:"hits"`
	} `json:"hits"`
}

This struct is for parsing block filter query response from Elasticsearch

type BlockNumber

type BlockNumber struct {
	BlockNumber uint64 `json:"blockNumber"`
	ChannelId   string `json:"channelId"`
}

This struct is for getting the block number from the block number response.

func GetBlockNumber

func GetBlockNumber(url string) (*BlockNumber, error)

Sends a GET Http request to the sepcified URL, parses the response and returns the block number.

type BlockNumberResponse

type BlockNumberResponse struct {
	Index       string      `json:"_index"`
	Type        string      `json:"_type"`
	Id          string      `json:"_id"`
	BlockNumber BlockNumber `json:"_source"`
}

This struct is for parsing the block number response from Elasticsearch.

Jump to

Keyboard shortcuts

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