Documentation
¶
Index ¶
- func Client() *elastic.Client
- func Index(index string) string
- func RegisterMapping(index, fileName string)
- func Setup(ctx context.Context) error
- func StoreBlock(ctx context.Context, b BlockData) (*elastic.IndexResponse, error)
- func StoreTransaction(ctx context.Context, t *TransactionData) (*elastic.IndexResponse, error)
- type BlockData
- type BulkIndexer
- func (bi *BulkIndexer) Add(bir ...elastic.BulkableRequest)
- func (bi *BulkIndexer) BeginTimedCommits(rate time.Duration)
- func (bi *BulkIndexer) CheckSizeStore(ctx context.Context) (BulkIndexerResponse, error)
- func (bi *BulkIndexer) Commit()
- func (bi *BulkIndexer) DeleteBlock(hash string)
- func (bi *BulkIndexer) Do(ctx context.Context) (*elastic.BulkResponse, error)
- func (bi *BulkIndexer) EndTimedCommit()
- func (bi *BulkIndexer) EstimateSizeInBytes() int64
- func (bi *BulkIndexer) NumberOfActions() int
- func (bi *BulkIndexer) OrphanBlock(hash string)
- func (bi *BulkIndexer) StoreBlock(bd BlockData)
- func (bi *BulkIndexer) StoreTransaction(td *TransactionData)
- type BulkIndexerResponse
- type TransactionData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMapping ¶
func RegisterMapping(index, fileName string)
func StoreBlock ¶
func StoreTransaction ¶
func StoreTransaction(ctx context.Context, t *TransactionData) (*elastic.IndexResponse, error)
Types ¶
type BlockData ¶
type BlockData struct {
Block *flojson.GetBlockVerboseResult `json:"block"`
SecSinceLastBlock int64 `json:"sec_since_last_block"`
Orphaned bool `json:"orphaned"`
}
type BulkIndexer ¶
type BulkIndexer struct {
// contains filtered or unexported fields
}
var AutoBulk BulkIndexer
func BeginBulkIndexer ¶
func BeginBulkIndexer() BulkIndexer
func (*BulkIndexer) Add ¶
func (bi *BulkIndexer) Add(bir ...elastic.BulkableRequest)
func (*BulkIndexer) BeginTimedCommits ¶
func (bi *BulkIndexer) BeginTimedCommits(rate time.Duration)
func (*BulkIndexer) CheckSizeStore ¶
func (bi *BulkIndexer) CheckSizeStore(ctx context.Context) (BulkIndexerResponse, error)
func (*BulkIndexer) Commit ¶
func (bi *BulkIndexer) Commit()
func (*BulkIndexer) DeleteBlock ¶
func (bi *BulkIndexer) DeleteBlock(hash string)
func (*BulkIndexer) Do ¶
func (bi *BulkIndexer) Do(ctx context.Context) (*elastic.BulkResponse, error)
func (*BulkIndexer) EndTimedCommit ¶
func (bi *BulkIndexer) EndTimedCommit()
func (*BulkIndexer) EstimateSizeInBytes ¶
func (bi *BulkIndexer) EstimateSizeInBytes() int64
func (*BulkIndexer) NumberOfActions ¶
func (bi *BulkIndexer) NumberOfActions() int
func (*BulkIndexer) OrphanBlock ¶
func (bi *BulkIndexer) OrphanBlock(hash string)
func (*BulkIndexer) StoreBlock ¶
func (bi *BulkIndexer) StoreBlock(bd BlockData)
func (*BulkIndexer) StoreTransaction ¶
func (bi *BulkIndexer) StoreTransaction(td *TransactionData)
type BulkIndexerResponse ¶
type BulkIndexerResponse struct {
*elastic.BulkResponse
EstimatedSize int64
Stored bool
}
type TransactionData ¶
type TransactionData struct {
Block int64 `json:"block"`
BlockHash string `json:"block_hash"`
Confirmed bool `json:"confirmed"`
IsCoinbase bool `json:"is_coinbase"`
Transaction *flojson.TxRawResult `json:"tx"`
Fee *float64 `json:"fee,omitempty"`
FeeSat *int64 `json:"fee_sat,omitempty"`
}
func GetTransactionFromID ¶
func GetTransactionFromID(ctx context.Context, id string) (TransactionData, error)
Click to show internal directories.
Click to hide internal directories.