models

package
v0.10.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchMixStatus

type BatchMixStatus struct {
	Status []MixStatus `json:"status" binding:"required"`
}

BatchMixStatus allows to indicate whether given set of nodes is up or down, as reported by a Nym monitor node.

type BatchMixStatusReport

type BatchMixStatusReport struct {
	Report []MixStatusReport `json:"report" binding:"required"`
}

BatchMixStatusReport gives a quick view of network uptime performance

type Error

type Error struct {
	Error string `json:"error"`
}

Error ...

type GatewayRegistrationInfo

type GatewayRegistrationInfo struct {
	NodeInfo
	ClientsHost string `json:"clientsHost" binding:"required"`
}

type MixRegistrationInfo

type MixRegistrationInfo struct {
	NodeInfo
	Layer uint `json:"layer" binding:"required"`
}

type MixStatus

type MixStatus struct {
	PubKey    string `json:"pubKey" binding:"required" gorm:"index:status_index"`
	IPVersion string `json:"ipVersion" binding:"required" gorm:"index:status_index"`
	Up        *bool  `json:"up" binding:"required"`
}

MixStatus indicates whether a given node is up or down, as reported by a Nym monitor node. The 'Up' field is pretty annoying. Gin and other HTTP routers ignore incoming json "false" values, so making it a pointer works. This necessitates crapification of the Up-related code, as you can't do `*true` or `&true`, you need a variable to point to or dereference. This is why you'll see e.g. things like `booltrue := true`, `&booltrue` in the codebase. Maybe there's a more elegant way to achieve that which a bigger gopher could clean up.

type MixStatusReport

type MixStatusReport struct {
	PubKey           string `json:"pubKey" binding:"required" gorm:"primaryKey;unique"`
	MostRecentIPV4   bool   `json:"mostRecentIPV4" binding:"required"`
	Last5MinutesIPV4 int    `json:"last5MinutesIPV4" binding:"required"`
	LastHourIPV4     int    `json:"lastHourIPV4" binding:"required"`
	LastDayIPV4      int    `json:"lastDayIPV4" binding:"required"`
	MostRecentIPV6   bool   `json:"mostRecentIPV6" binding:"required"`
	Last5MinutesIPV6 int    `json:"last5MinutesIPV6" binding:"required"`
	LastHourIPV6     int    `json:"lastHourIPV6" binding:"required"`
	LastDayIPV6      int    `json:"lastDayIPV6" binding:"required"`
}

MixStatusReport gives a quick view of mixnode uptime performance

type NodeInfo

type NodeInfo struct {
	MixHost           string `json:"mixHost" binding:"required"`
	IdentityKey       string `json:"identityKey" binding:"required" gorm:"primaryKey;unique"`
	SphinxKey         string `json:"sphinxKey" binding:"required"`
	Version           string `json:"version" binding:"required"`
	Location          string `json:"location"`
	IncentivesAddress string `json:"incentivesAddress"`
}

NodeInfo comes from a node telling us it's alive

type PersistedMixStatus

type PersistedMixStatus struct {
	MixStatus
	Timestamp int64 `json:"timestamp" binding:"required" gorm:"index:status_index,sort:desc"`
}

PersistedMixStatus is a saved MixStatus with a timestamp recording when it was seen by the directory server. It can be used to build visualizations of mixnode uptime.

type RegisteredGateway

type RegisteredGateway struct {
	GatewayRegistrationInfo
	RegistrationTime int64          `json:"registrationTime" gorm:"autoCreateTime:nano"`
	Reputation       int64          `json:"reputation"`
	Deleted          gorm.DeletedAt `json:"-"`
}

type RegisteredMix

type RegisteredMix struct {
	MixRegistrationInfo
	RegistrationTime int64          `json:"registrationTime" gorm:"autoCreateTime:nano"`
	Reputation       int64          `json:"reputation"`
	Deleted          gorm.DeletedAt `json:"-"`
}

type RemovedGateway

type RemovedGateway struct {
	RegisteredGateway
}

type RemovedMix

type RemovedMix struct {
	RegisteredMix
}

I don't think there's a way around it as gorm seems to make tables based on the structs provided

type Topology

type Topology struct {
	MixNodes   []RegisteredMix            `json:"mixNodes" binding:"required"`
	Gateways   []RegisteredGateway        `json:"gateways" binding:"required"`
	Validators rpc.ResultValidatorsOutput `json:"validators"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL