Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectDatabase ¶
func ConnectDatabase()
func GetDatabase ¶
Types ¶
type AddressEntry ¶
type AddressEntry struct {
gorm.Model
// ID of the record, auto incremented uint64 value
ID uint64 `gorm:"primaryKey;autoIncrement:true"`
// Address is the newly fetched address that differs from the previous registered
Address string `gorm:"index" json:"address"`
// PreviousAddress is the previous address, before the update
PreviousAddress string `json:"previous_address"`
// Version specifies the version of the address this record refers to
Version string `json:"version"`
// CreatedAt is the UNIX time when the address update was detected
CreatedAt uint64 `gorm:"autoCreateTime" json:"at"`
}
func (AddressEntry) Create ¶
func (e AddressEntry) Create(address string, version string, previous string) (*AddressEntry, error)
Create is the function that creates a new AddressEntry record onto the database
func (AddressEntry) First ¶
func (e AddressEntry) First(addressVersion string) (*AddressEntry, error)
First returns the latest added record for a specific address version (addressVersion)
Click to show internal directories.
Click to hide internal directories.