Documentation
¶
Index ¶
- type AccountRewardHistory
- type AssumedCoverageHistory
- type AssumedGatewayCoverageHistory
- type AssumedUnverifiedCoverage
- type CoverageHistory
- type FrequencyPlan
- type Gateway
- type GatewayEvent
- type GatewayEventType
- type GatewayHistory
- type GatewayRewardHistory
- type ID
- type Mapper
- type MapperEvent
- type MapperEventType
- type MapperHistory
- type MapperRewardHistory
- type MappingDiscoveryReceiptRecord
- type MappingDownlinkReceiptRecord
- type MappingRecord
- type MappingRecordValidation
- type RewardHistory
- type Router
- type RouterEvent
- type RouterEventType
- type RouterHistory
- type UnverifiedMappingGatewayRecord
- type UnverifiedMappingRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountRewardHistory ¶
type AccountRewardHistory struct {
// The acount this reward history is for
Account common.Address `json:"account"`
// The reward in THIX "gweis" for this account at this moment
Rewards *big.Int `json:"rewards"`
// The sum of rewards ever received uptil now
TotalRewards *big.Int `json:"totalRewards"`
// The processor that can process the cheque for the total rewards
Processor common.Address `json:"processor"`
// The signature by the cheque creator that can be used to claim the rewards
Signature hexutil.Bytes `json:"signature"`
// Date these rewards where issued
Date time.Time `json:"date"`
}
func (AccountRewardHistory) MarshalJSON ¶
func (arh AccountRewardHistory) MarshalJSON() ([]byte, error)
type AssumedCoverageHistory ¶
type AssumedCoverageHistory struct {
// Res 8 cell of the location of the coverage
Location h3light.Cell `json:"location"`
// The coverage as being provided by one or multiple gateways
GatewayCoverage []*AssumedGatewayCoverageHistory `json:"gatewayCoverage"`
// Date this coverage was (assumed to be) present based on the measurements
Date time.Time `json:"date"`
}
AssumedCoverageHistory stores the history (and therefore also current coverage) as assumed based in calculated coverage As not every location can be mapped, based on the actually mapped locations, a assumed coverage is calculated There can be multiple AssumedCoverageHistory's for the same location for different gateways.
type CoverageHistory ¶
type CoverageHistory struct {
// Res 10 cell of the location of the coverage
Location h3light.Cell `json:"location"`
// Date this coverage was (assumed to be) present based on the measurements
Date time.Time `json:"date"`
// ID of the gateway that provides this coverage
GatewayID ID `json:"gatewayId"`
// The location of the gateway that provides this coverage
GatewayLocation h3light.Cell `json:"gatewayLocation"`
// The frequency plan that coverage is provided for
FrequencyPlan frequency_plan.BandName `json:"frequencyPlan"`
// ID of the mapper that mapped this coverage
MapperID ID `json:"mapperId"`
// ID of the mapping record that was used to base this coverage on
MappingID ID `json:"mappingId"`
// Time of the mapping record that was used to base this coverage on
MappingTime time.Time `json:"mappingTime"`
// The RSSI (signal strength) of coverage at this location
RSSI int `json:"rssi"`
}
CoverageHistory stores the history (and therefore also current coverage) provided by the network
type FrequencyPlan ¶
type Gateway ¶
type Gateway struct {
// ID is the ThingsIX compressed public key for this gateway
ID ID `json:"id" gorm:"primaryKey;type:bytea"`
ContractAddress common.Address `json:"contract"`
Version uint8 `json:"version"`
Owner common.Address `json:"owner" gorm:"index;type:bytea"`
AntennaGain *float32 `json:"antennaGain,omitempty"`
FrequencyPlan *frequency_plan.BandName `json:"frequencyPlan,omitempty"`
Location *h3light.Cell `json:"location,omitempty"`
Altitude *uint `json:"altitude,omitempty"`
}
type GatewayEvent ¶
type GatewayEvent struct {
ContractAddress common.Address `json:"contract"`
Block common.Hash `json:"blockHash"`
Transaction common.Hash `json:"transaction"`
BlockNumber uint64 `json:"blockNumber"`
TransactionIndex uint `json:"transactionIndex"`
LogIndex uint `json:"logIndex"`
Time time.Time `json:"time"`
Type GatewayEventType `json:"type"`
ID ID `json:"id"`
Version uint8 `json:"version"`
NewOwner *common.Address `json:"newOwner"`
OldOwner *common.Address `json:"oldOwner"`
NewLocation *h3light.Cell `json:"newLocation,omitempty"`
OldLocation *h3light.Cell `json:"oldLocation,omitempty"`
NewAltitude *uint `json:"newAltitude,omitempty"`
OldAltitude *uint `json:"oldAltitude,omitempty"`
NewFrequencyPlan *frequency_plan.BandName `json:"newFrequencyPlan,omitempty"`
OldFrequencyPlan *frequency_plan.BandName `json:"oldFrequencyPlan,omitempty"`
NewAntennaGain *float32 `json:"newAntennaGain,omitempty"`
OldAntennaGain *float32 `json:"oldAntennaGain,omitempty"`
}
GatewayEvent represents a log emitted by the gateway registry that is related to a gateway.
type GatewayEventType ¶
type GatewayEventType string
const ( GatewayOnboardedEvent GatewayEventType = "onboard" GatewayOffboardedEvent GatewayEventType = "offboard" GatewayUpdatedEvent GatewayEventType = "update" GatewayTransferredEvent GatewayEventType = "transfer" GatewayUnknownEvent GatewayEventType = "unknown" )
func (GatewayEventType) MarshalText ¶
func (event GatewayEventType) MarshalText() ([]byte, error)
func (*GatewayEventType) Scan ¶
func (event *GatewayEventType) Scan(value interface{}) error
func (*GatewayEventType) UnmarshalText ¶
func (event *GatewayEventType) UnmarshalText(input []byte) error
type GatewayHistory ¶
type GatewayHistory struct {
ContractAddress common.Address `json:"contract"`
Block common.Hash `json:"blockHash"`
Transaction common.Hash `json:"transaction"`
BlockNumber uint64 `json:"blockNumber"`
Time time.Time `json:"time"`
ID ID `json:"id"`
Version uint8 `json:"version"`
Owner *common.Address `json:"owner"`
AntennaGain *float32 `json:"antennaGain,omitempty"`
FrequencyPlan *frequency_plan.BandName `json:"frequencyPlan,omitempty"`
Location *h3light.Cell `json:"location,omitempty"`
Altitude *uint `json:"altitude,omitempty"`
}
func (*GatewayHistory) Gateway ¶
func (gh *GatewayHistory) Gateway() *Gateway
type GatewayRewardHistory ¶
type GatewayRewardHistory struct {
// ID of the gateway
GatewayID ID `json:"gatewayId"`
// Date these rewards where issued
Date time.Time `json:"date"`
AssumedCoverageShareUnits *big.Int `json:"assumedCoverageUnits"`
// The reward in THIX "gweis" for this gateway
Rewards *big.Int `json:"rewards"`
}
GatewayRewardHistory stores the historical data of rewards as received by a gateway
func (GatewayRewardHistory) MarshalJSON ¶
func (grh GatewayRewardHistory) MarshalJSON() ([]byte, error)
type ID ¶
type ID [32]byte
func IDFromBytes ¶
func IDFromPublicKeyBytes ¶
func IDFromRandom ¶
func IDFromRandom() ID
func IDFromString ¶
func (ID) MarshalText ¶
func (*ID) UnmarshalText ¶
type MapperEvent ¶
type MapperEvent struct {
ContractAddress common.Address `json:"contract"`
Block common.Hash `json:"blockHash"`
Transaction common.Hash `json:"transaction"`
BlockNumber uint64 `json:"blockNumber"`
TransactionIndex uint `json:"transactionIndex"`
LogIndex uint `json:"logIndex"`
Type MapperEventType `json:"type"`
ID ID `json:"id"`
Revision uint16 `json:"revision"`
FrequencyPlan frequency_plan.BandName `json:"frequencyPlan"`
NewOwner *common.Address `json:"newOwner"`
OldOwner *common.Address `json:"oldOwner"`
Time time.Time `json:"time"`
}
type MapperEventType ¶
type MapperEventType string
const ( // RegisterEvent is raised when a mapper is registered registry by ThingsIX MapperRegisteredEvent MapperEventType = "register" // OnboardEvent is raised when a mapper is onboarded by its owner MapperOnboardedEvent MapperEventType = "onboard" // ClaimEvent is raised when a mapper is claimed by ThingsIX MapperClaimedEvent MapperEventType = "claim" // RemovedEvent is raised when a mapper is removed from the registry MapperRemovedEvent MapperEventType = "removed" // MapperDeactivated is raised when ThingsIX marks a mapper as inactive MapperDeactivated MapperEventType = "deactivated" // MapperActive is raised when ThingsIX marks a mapper as active MapperActivated MapperEventType = "activated" // MapperTransfer is raised when the mapper is transferred to a different owner MapperTransfered = "transfer" MapperUnknownEvent MapperEventType = "unknown" )
func (MapperEventType) MarshalText ¶
func (event MapperEventType) MarshalText() ([]byte, error)
func (*MapperEventType) Scan ¶
func (event *MapperEventType) Scan(value interface{}) error
func (*MapperEventType) UnmarshalText ¶
func (event *MapperEventType) UnmarshalText(input []byte) error
type MapperHistory ¶
type MapperHistory struct {
ContractAddress common.Address `json:"contract"`
Block common.Hash `json:"blockHash"`
Transaction common.Hash `json:"transaction"`
BlockNumber uint64 `json:"blockNumber"`
Time time.Time `json:"time"`
ID ID `json:"id"`
Revision uint16 `json:"revision"`
Owner *common.Address `json:"owner"`
FrequencyPlan frequency_plan.BandName `json:"frequencyPlan"`
Active bool `json:"active"`
}
func (*MapperHistory) Mapper ¶
func (mh *MapperHistory) Mapper() *Mapper
type MapperRewardHistory ¶
type MapperRewardHistory struct {
// ID of the mapper
MapperID ID `json:"mapperId"`
// Date these rewards where issued
Date time.Time `json:"date"`
// The total amount of MappingUnits the mapper got rewards for
MappingUnits *big.Int `json:"mappingUnits"`
// The reward in THIX "gweis" for this mapper
Rewards *big.Int `json:"rewards"`
}
MapperRewardHistory stores the historical data of rewards as received by a mapper
func (MapperRewardHistory) MarshalJSON ¶
func (mrh MapperRewardHistory) MarshalJSON() ([]byte, error)
type MappingDiscoveryReceiptRecord ¶
type MappingDiscoveryReceiptRecord struct {
Frequency uint32 `json:"frequency,omitempty"`
Rssi int32 `json:"rssi,omitempty"`
Snr float64 `json:"snr,omitempty"`
SpreadingFactor uint32 `json:"spreadingFactor,omitempty"`
Bandwidth uint32 `json:"bandwidth,omitempty"`
CodeRate string `json:"codeRate,omitempty"`
Phy []byte `json:"phy,omitempty"`
ReceivedTime time.Time `json:"receivedTime,omitempty"`
GatewayTime time.Time `json:"gatewayTime,omitempty"`
GatewaySignature []byte `json:"gatewaySignature,omitempty"`
GatewayID ID `json:"gatewayId,omitempty"`
GatewayLocation *h3light.Cell `json:"gatewayLocation,omitempty"`
MapperID ID `json:"mapperId,omitempty"`
ServiceValidation MappingRecordValidation `json:"serviceValidation"`
}
func (*MappingDiscoveryReceiptRecord) MappingID ¶
func (mdrr *MappingDiscoveryReceiptRecord) MappingID() ID
Return the
type MappingDownlinkReceiptRecord ¶
type MappingDownlinkReceiptRecord struct {
Frequency uint32 `json:"frequency,omitempty"`
Rssi int32 `json:"rssi,omitempty"`
Snr float64 `json:"snr,omitempty"`
SpreadingFactor uint32 `json:"spreadingFactor,omitempty"`
Bandwidth uint32 `json:"bandwidth,omitempty"`
CodeRate string `json:"codeRate,omitempty"`
Phy []byte `json:"phy,omitempty"`
ReceivedTime time.Time `json:"receivedTime,omitempty"`
GatewayTime time.Time `json:"gatewayTime,omitempty"`
GatewaySignature []byte `json:"gatewaySignature,omitempty"`
GatewayID ID `json:"gatewayId,omitempty"`
MapperID ID `json:"mapperId,omitempty"`
ServiceValidation MappingRecordValidation `json:"serviceValidation"`
}
type MappingRecord ¶
type MappingRecord struct {
ID ID `json:"id"`
DiscoveryReceiptRecords []*MappingDiscoveryReceiptRecord `json:"discoveryReceiptRecords"`
DiscoveryPhy []byte `json:"discoveryPhy"`
DownlinkReceiptRecords []*MappingDownlinkReceiptRecord `json:"downlinkReceiptRecords"`
DownlinkPhy []byte `json:"downlinkPhy"`
MeasuredRssi *int `json:"measuredRssi"`
MeasuredSnr *int `json:"measuredSnr"`
FrequencyPlan frequency_plan.BandName `json:"frequencyPlan"`
ChallengedGatewayID *ID `json:"challengedGatewayId"`
ChallengedGatewayLocation *h3light.Cell `json:"challengedGatewayLocation"`
ChallengedTime *time.Time `json:"challengedTime"`
MapperID ID `json:"mapperId"`
MapperLocation h3light.Cell `json:"mapperLocation"`
MapperLat float64 `json:"mapperLat"`
MapperLon float64 `json:"mapperLon"`
MapperHeight float64 `json:"mapperHeight"`
MapperOsnmaAge uint8 `json:"mapperOsnmaAge"`
MapperSpoofing uint8 `json:"mapperSpoofing"`
MapperTow uint32 `json:"mapperTow"`
MapperBattery uint8 `json:"mapperBattery"`
MapperVersion uint8 `json:"mapperVersion"`
MapperStatus uint8 `json:"mapperStatus"`
ReceivedTime time.Time `json:"receivedTime"`
ServiceValidation MappingRecordValidation `json:"serviceValidation"`
}
func (*MappingRecord) MappingID ¶
func (mr *MappingRecord) MappingID() ID
Return the MappingID of this MappingRecord, on the
type MappingRecordValidation ¶
type MappingRecordValidation string
const ( // All validations succeeded, note that later validations can still fail MappingRecordValidationOk MappingRecordValidation = "ok" // No discovery receipt was received MappingRecordValidationNoDiscoveryReceipt MappingRecordValidation = "no-discovery-receipt" // No downlink was transmitted (in time) MappingRecordValidationNoDownlink MappingRecordValidation = "no-downlink" // No downlink receipt was received (in time) MappingRecordValidationNoDownlinkReceipt MappingRecordValidation = "no-downlink-receipt" // The receipt was received on a wrong channel/frequency MappingRecordValidationWrongFrequency MappingRecordValidation = "wrong-frequency" // The receipt was received with a wrong spreading factor MappingRecordValidationWrongSpreadingFactor MappingRecordValidation = "wrong-spreading-factor" // There was a mismatch between the frequency-plan and the location of the mapper and/or of the receiving gateway MappingRecordValidationWrongFrequencyPlan MappingRecordValidation = "wrong-frequency-plan" // The distance between the mapper and the receiving is too large MappingRecordValidationTooLargeDistance MappingRecordValidation = "too-large-distance" // The RSSI and/or SNR are unlikely for the distance between the mapper and the receiving gateway MappingRecordValidationUnlikelyRssiSnr MappingRecordValidation = "unlikely-rssi-snr" // The RSSI is out of the acceptable bounds (too high or too low) MappingRecordValidationRssiOutOfBounds MappingRecordValidation = "rssi-out-of-bounds" // The receiving gateway is (temporarily) denylisted due to previous suspicious mapping-values MappingRecordValidationGatewayDenylisted MappingRecordValidation = "gateway-denylisted" // The receiving gateway is blocklisted due to previous suspicious mapping-values MappingRecordValidationGatewayBlocklisted MappingRecordValidation = "gateway-blocklisted" // The mpper is (temporarily) denylisted due to previous suspicious mapping-values MappingRecordValidationMapperTemporarilyDenylisted MappingRecordValidation = "mapper-temp-denylisted" // The mapper is blocklisted due to previous suspicious mapping-values MappingRecordValidationMapperBlocklisted MappingRecordValidation = "mapper-blocklisted" // The mapper is blocklisted due to previous suspicious mapping-values MappingRecordValidationMapperNotActive MappingRecordValidation = "mapper-not-active" // The mapper record was too old once it was received and delivered to the service MappingRecordValidationTooOld MappingRecordValidation = "too-old" // The location of the mapper or receiving gateway was invalid MappingRecordValidationInvalidLocation MappingRecordValidation = "invalid-location" // The location of the mapper was too high or low with respect to the earth surface MappingRecordValidationInvalidHeight MappingRecordValidation = "invalid-height" // The GPS-security validation by the mapper was invalid MappingRecordValidationInvalidGpsSecurity MappingRecordValidation = "invalid-gps-security" // The OSNMA validation by the mapper was not sufficient MappingRecordValidationInsufficientGpsSecurity MappingRecordValidation = "insufficient-gps-security" // An internal server error occcured during validation MappingRecordValidationInternalServerError MappingRecordValidation = "internal-server-error" )
type RewardHistory ¶
type RewardHistory struct {
// Date these rewards where issued
Date time.Time `json:"date"`
TotalAssumedCoverageShareUnits *big.Int `json:"totalAssumedCoverageUnits"`
// The total amount of MappingUnits the mapper got rewards for
TotalMappingUnits *big.Int `json:"totalMappingUnits"`
// The total rewards issued in THIX "gweis"
TotalRewards *big.Int `json:"totalRewards"`
}
type Router ¶
type Router struct {
ID ID `json:"id"`
ContractAddress common.Address `json:"contract"`
Owner common.Address `json:"owner"`
NetID uint32 `json:"netid"`
Prefix uint32 `json:"prefix"`
Mask uint8 `json:"mask"`
FrequencyPlan frequency_plan.BandName `json:"frequencyPlan"`
Endpoint string `json:"endpoint"`
}
type RouterEvent ¶
type RouterEvent struct {
ContractAddress common.Address `json:"contract"`
Block common.Hash `json:"blockHash"`
Transaction common.Hash `json:"transaction"`
BlockNumber uint64 `json:"blockNumber"`
TransactionIndex uint `json:"transactionIndex"`
LogIndex uint `json:"logIndex"`
Time time.Time `json:"time"`
Type RouterEventType `json:"type"`
ID ID `json:"id"`
Owner *common.Address `json:"owner"`
NewNetID *uint32 `json:"newNetid"`
OldNetID *uint32 `json:"oldNetid"`
NewPrefix *uint32 `json:"newPrefix"`
OldPrefix *uint32 `json:"oldPrefix"`
NewMask *uint8 `json:"newMask"`
OldMask *uint8 `json:"oldMask"`
NewFrequencyPlan *frequency_plan.BandName `json:"newFrequencyPlan"`
OldFrequencyPlan *frequency_plan.BandName `json:"oldFrequencyPlan"`
NewEndpoint *string `json:"newEndpoint"`
OldEndpoint *string `json:"oldEndpoint"`
}
type RouterEventType ¶
type RouterEventType string
const ( // RouterRegisteredEvent is raised when a router is registered by its manager RouterRegisteredEvent RouterEventType = "register" // RegisterEvent is raised when a router details are updated RouterUpdatedEvent RouterEventType = "update" // RouterRemovedEvent is raised when router details are removed RouterRemovedEvent RouterEventType = "removed" RouterUnknownEvent RouterEventType = "unknown" )
func (RouterEventType) MarshalText ¶
func (event RouterEventType) MarshalText() ([]byte, error)
func (*RouterEventType) Scan ¶
func (event *RouterEventType) Scan(value interface{}) error
func (*RouterEventType) UnmarshalText ¶
func (event *RouterEventType) UnmarshalText(input []byte) error
type RouterHistory ¶
type RouterHistory struct {
ContractAddress common.Address `json:"contract"`
Block common.Hash `json:"blockHash"`
Transaction common.Hash `json:"transaction"`
BlockNumber uint64 `json:"blockNumber"`
Time time.Time `json:"time"`
ID ID `json:"id" gorm:"primaryKey;type:bytea"`
Owner *common.Address `json:"owner"`
NetID uint32 `json:"netid"`
Prefix uint32 `json:"prefix"`
Mask uint8 `json:"mask"`
FrequencyPlan frequency_plan.BandName `json:"frequencyPlan"`
Endpoint string `json:"endpoint"`
}
func (*RouterHistory) Router ¶
func (rh *RouterHistory) Router() *Router
type UnverifiedMappingGatewayRecord ¶
type UnverifiedMappingGatewayRecord struct {
MappingID ID `json:"mappingId"`
GatewayID ID `json:"gatewayId,omitempty"`
GatewayLocation *h3light.Cell `json:"gatewayLocation,omitempty"`
GatewayTime time.Time `json:"gatewayTime,omitempty"`
Rssi int32 `json:"rssi,omitempty"`
Snr float64 `json:"snr,omitempty"`
}
type UnverifiedMappingRecord ¶
type UnverifiedMappingRecord struct {
ID ID `json:"id"`
GatewayRecords []*UnverifiedMappingGatewayRecord `json:"gatewayRecords"`
MapperID string `json:"mapperId"`
BestGatewayID *ID `json:"bestGatewayId"`
BestGatewayLocation *h3light.Cell `json:"bestGatewayLocation"`
BestGatewayRssi *int32 `json:"bestGatewayRssi"`
BestGatewaySnr *float64 `json:"bestGatewaySnr"`
MapperLocation h3light.Cell `json:"mapperLocation"`
MapperLat float64 `json:"mapperLat"`
MapperLon float64 `json:"mapperLon"`
MapperAccuracy float64 `json:"mapperAccuracy"`
MapperHeight float64 `json:"mapperHeight"`
ReceivedTime time.Time `json:"receivedTime"`
Frequency uint32 `json:"frequency,omitempty"`
SpreadingFactor uint32 `json:"spreadingFactor,omitempty"`
Bandwidth uint32 `json:"bandwidth,omitempty"`
CodeRate string `json:"codeRate,omitempty"`
}
Source Files
¶
- account_reward_history.go
- assumed_coverage_history.go
- coverage_history.go
- frequency_plan.go
- gateway.go
- gateway_event.go
- gateway_event_type.go
- gateway_history.go
- gateway_reward_history.go
- id.go
- mapper.go
- mapper_event.go
- mapper_event_type.go
- mapper_history.go
- mapper_reward_history.go
- mapping_discovery_receipt_record.go
- mapping_downlink_receipt_record.go
- mapping_record.go
- mapping_record_validation.go
- reward_history.go
- router.go
- router_event.go
- router_event_type.go
- router_history.go
- unverified_assumed_coverage.go
- unverified_mapping_record.go