Documentation ¶
Index ¶
- Variables
- func BigIntToInt64(value *big.Int) int64
- func BigIntToString(value *big.Int) string
- func ConvertInt256HexToBigInt(hex string) *big.Int
- func ConvertIntStringToHex(n string) (string, error)
- func ConvertUint256HexToBigInt(hex string) *big.Int
- func Create(headerID int64, models []InsertionModel, db *postgres.DB) error
- func DecodeHexToText(payload string) string
- func GetEventTransformerConfig(transformerLabel, signature string) transformer.EventTransformerConfig
- func GetLogNoteArgumentAtIndex(index int, logData []byte) ([]byte, error)
- func GetOrCreateIlk(ilk string, db *postgres.DB) (int, error)
- func GetOrCreateIlkInTransaction(ilk string, tx *sqlx.Tx) (int, error)
- func GetOrCreateUrn(guy string, hexIlk string, db *postgres.DB) (urnID int, err error)
- func GetOrCreateUrnInTransaction(guy string, hexIlk string, tx *sqlx.Tx) (urnID int, err error)
- func MinInt64(ints []int64) (min int64)
- type ColumnValues
- type ForeignKeyValues
- type InsertionModel
- type LogNoteConverter
- type LogNoteTransformer
- type SharedRepository
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BigIntToInt64 ¶
func BigIntToString ¶
func ConvertInt256HexToBigInt ¶ added in v0.2.3
func ConvertIntStringToHex ¶ added in v0.2.2
func ConvertUint256HexToBigInt ¶ added in v0.2.3
func Create ¶ added in v0.2.8
func Create(headerID int64, models []InsertionModel, db *postgres.DB) error
Given an instance of InsertionModel, example below, generates an insertion query and fills in
foreign keys automatically after getting from the DB. These "special fields" are populated in the columnToValue mapping, and are treated like any other in the insertion.
testModel = shared.InsertionModel{ TableName: "testEvent", OrderedColumns: []string{"header_id", "log_idx", "tx_idx", "raw_log", constants.IlkFK, constants.UrnFK, "variable1"}, ColumnValues: ColumnValues{ "log_idx": "1", "tx_idx": "2", "raw_log": fakeLog, "variable1": "value1", }, ForeignKeyValues: shared.ForeignKeyValues{ constants.IlkFK: test_helpers.FakeIlk.Hex, constants.UrnFK: "0x12345", }, }
func DecodeHexToText ¶ added in v0.2.4
func GetEventTransformerConfig ¶ added in v0.2.10
func GetEventTransformerConfig(transformerLabel, signature string) transformer.EventTransformerConfig
Creates a transformer config by pulling values from configuration environment
func GetLogNoteArgumentAtIndex ¶ added in v0.2.6
func GetOrCreateUrn ¶ added in v0.2.2
func GetOrCreateUrnInTransaction ¶ added in v0.2.2
Types ¶
type ColumnValues ¶ added in v0.2.8
type ColumnValues map[string]interface{}
type ForeignKeyValues ¶ added in v0.2.8
type ForeignKeyValues map[constants.ForeignKeyField]string
type InsertionModel ¶ added in v0.2.8
type InsertionModel struct { TableName string // For MarkHeaderChecked, insert query OrderedColumns []string // Defines the fields to insert, and in which order the table expects them // ColumnValues needs to be typed interface{}, since `raw_log` is a slice of bytes and not a string ColumnValues ColumnValues // Associated values for columns, headerID, FKs and event metadata populated automatically ForeignKeyValues ForeignKeyValues // FK name and value to get/create ID for }
type LogNoteConverter ¶ added in v0.2.3
type LogNoteConverter interface {
ToModels(ethLog []types.Log) ([]InsertionModel, error)
}
type LogNoteTransformer ¶ added in v0.2.3
type LogNoteTransformer struct { Config transformer.EventTransformerConfig Converter LogNoteConverter Repository SharedRepository }
func (LogNoteTransformer) GetConfig ¶ added in v0.2.3
func (tr LogNoteTransformer) GetConfig() transformer.EventTransformerConfig
func (LogNoteTransformer) GetName ¶ added in v0.2.3
func (tr LogNoteTransformer) GetName() string
func (LogNoteTransformer) NewLogNoteTransformer ¶ added in v0.2.3
func (tr LogNoteTransformer) NewLogNoteTransformer(db *postgres.DB) transformer.EventTransformer
type SharedRepository ¶ added in v0.2.8
type SharedRepository interface {}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.