Documentation ¶
Index ¶
- Variables
- func B(v bool) *bool
- func ConvertTokenToDecimal(amount *big.Int, decimals int64) *big.Float
- func ExponentToBigFloat(decimals int64) *big.Float
- func GetTableName(entity Interface) string
- func GetTableNameFromType(entity reflect.Type) string
- func S(str string) *string
- type Base
- func (e *Base) Exists() bool
- func (e *Base) GetBlockRange() *BlockRange
- func (e *Base) GetID() string
- func (e *Base) GetVID() uint64
- func (e *Base) SetBlockRange(br *BlockRange)
- func (e *Base) SetExists(exists bool)
- func (e *Base) SetID(id string)
- func (e *Base) SetMutated(step int)
- func (e *Base) SetUpdatedBlockNum(blockNum uint64)
- func (e *Base) SetVID(vid uint64)
- type BaseEvent
- type Block
- type BlockRange
- type Bool
- type Bytes
- type CSVProcessing
- type Cacheable
- type Enum
- type ExportedEntities
- type FieldTag
- type Finalizable
- type Float
- func (b *Float) Float() *big.Float
- func (b Float) MarshalCSV() ([]byte, error)
- func (b Float) MarshalJSON() ([]byte, error)
- func (b Float) Ptr() *Float
- func (b *Float) Scan(value interface{}) error
- func (b Float) String() string
- func (b Float) StringRounded(digits int) string
- func (b *Float) UnmarshalJSON(data []byte) error
- func (b Float) Value() (driver.Value, error)
- type Int
- func (b Int) AsFloat() Float
- func (i *Int) Int() *big.Int
- func (b Int) MarshalCSV() ([]byte, error)
- func (b Int) MarshalJSON() ([]byte, error)
- func (i Int) Ptr() *Int
- func (b *Int) Scan(value interface{}) error
- func (b Int) String() string
- func (b *Int) UnmarshalJSON(data []byte) error
- func (b Int) Value() (driver.Value, error)
- type Interface
- type LocalStringArray
- type Map
- type Mergeable
- type NamedEntity
- type POI
- func (p *POI) AddEnt(entityType string, ent interface{}) error
- func (p *POI) AggregateDigest(previousDigest []byte)
- func (p *POI) Apply()
- func (p *POI) Clear()
- func (p *POI) IsFinal(_ uint64, _ time.Time) bool
- func (p *POI) RemoveEnt(entityType, entityId string) error
- func (p *POI) TableName() string
- type Registry
- func (r *Registry) Data() map[string]reflect.Type
- func (r *Registry) Entities() []Interface
- func (r *Registry) GetInterface(tableName string) (Interface, bool)
- func (r *Registry) GetType(tableName string) (reflect.Type, bool)
- func (r *Registry) Len() int
- func (r *Registry) Register(entities ...Interface)
- type Sanitizable
- type Transaction
Constants ¶
This section is empty.
Variables ¶
var ONE_BI = new(big.Int).SetUint64(1)
Functions ¶
func ExponentToBigFloat ¶
func GetTableName ¶
func GetTableNameFromType ¶
Types ¶
type Base ¶
type Base struct { ID string `db:"id" csv:"id"` // text key VID uint64 `db:"vid" csv:"-" poi:"-"` // version BlockRange *BlockRange `db:"block_range" csv:"block_range"` UpdatedBlockNum uint64 `db:"_updated_block_number" csv:"updated_block_number" poi:"-"` MutatedOnStep int `db:"-" csv:"-" poi:"-"` // contains filtered or unexported fields }
func (*Base) GetBlockRange ¶
func (e *Base) GetBlockRange() *BlockRange
func (*Base) SetBlockRange ¶
func (e *Base) SetBlockRange(br *BlockRange)
func (*Base) SetMutated ¶
func (*Base) SetUpdatedBlockNum ¶
type BaseEvent ¶
type BaseEvent struct { Block *Block Transaction *Transaction }
func (*BaseEvent) SetBlockAndTransaction ¶
func (e *BaseEvent) SetBlockAndTransaction(b *pbcodec.Block, t *pbcodec.TransactionTrace)
type BlockRange ¶
func (*BlockRange) MarshalCSV ¶
func (b *BlockRange) MarshalCSV() ([]byte, error)
func (*BlockRange) ParseBytes ¶
func (b *BlockRange) ParseBytes(bs []byte) error
func (*BlockRange) Scan ¶
func (b *BlockRange) Scan(value interface{}) error
func (*BlockRange) String ¶
func (b *BlockRange) String() string
func (*BlockRange) UnmarshalJSON ¶
func (b *BlockRange) UnmarshalJSON(data []byte) error
type CSVProcessing ¶
type CSVProcessing interface {
Process(previous Interface)
}
type ExportedEntities ¶
type ExportedEntities struct { BlockNum uint64 BlockTimestamp time.Time EntityName string Entities Map TypeGetter interface { GetType(string) (reflect.Type, bool) } `json:"-"` }
func (*ExportedEntities) UnmarshalJSON ¶
func (ee *ExportedEntities) UnmarshalJSON(in []byte) error
type Finalizable ¶
An entity which is finalizeable is one that you guarantee will not be read nor written to anymore. In this case, you could purge it from a cache or write them early to a store
type Float ¶
type Float struct {
// contains filtered or unexported fields
}
func NewFloatFromLiteral ¶
func (Float) MarshalCSV ¶
func (Float) MarshalJSON ¶
func (Float) StringRounded ¶
func (*Float) UnmarshalJSON ¶
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
func NewIntFromLiteral ¶
func (*Int) Int ¶
To "copy" an Int value, an existing (or newly allocated) Int must be set to a new value using the Int.Set method; shallow copies of Ints are not supported and may lead to errors.
func (Int) MarshalCSV ¶
func (Int) MarshalJSON ¶
func (*Int) UnmarshalJSON ¶
type Interface ¶
type Interface interface { GetID() string SetID(id string) GetVID() uint64 SetVID(uint64) SetBlockRange(br *BlockRange) GetBlockRange() *BlockRange SetUpdatedBlockNum(blockNum uint64) Exists() bool SetExists(exists bool) SetMutated(step int) }
type LocalStringArray ¶
type LocalStringArray pq.StringArray
func ArrayAdd ¶
func ArrayAdd(a, b LocalStringArray) LocalStringArray
func (*LocalStringArray) MarshalCSV ¶
func (b *LocalStringArray) MarshalCSV() ([]byte, error)
func (*LocalStringArray) Scan ¶
func (a *LocalStringArray) Scan(src interface{}) error
Scan implements the sql.Scanner interface.
type Mergeable ¶
An entity that is mergeable is able to take an Entity from a previous _parallel step_, and merge it with the one from the current step. It needs to understand the state of the data in each field, at which step each field is "ready" (or valid), and know how to merge them.
The Entity that is kept is the _receiver_ of the method, the previous is not kept around. You are guaranteed that the type of `previous` will be the same as the _receiver_.
For example, a field like `TransactionCount` that is computed on step 2, will want to be sum'ed up on step 3. You do not want to merge anything on step 1 because the data for TransactionCount is not "ready" on that step.
Another example would be a field that computes an average over time. Merging an average would mean adding the two and dividing by two, but for the step at which we know the data was properly computed: if the update to the value comes from step 3, you will want to only apply the merge at step 4.
NOTE: You should use `previous.MutatedOnStep` to validate the entity was effectively changed at the step you expect it to have changed. In some situations, this might not be the case.
type NamedEntity ¶
type NamedEntity interface {
TableName() string
}
type POI ¶
type POI struct { Base Digest Bytes `db:"digest" csv:"digest"` // contains filtered or unexported fields }
func (*POI) AggregateDigest ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
type Sanitizable ¶
type Sanitizable interface {
Sanitize()
}