apimodels

package
v0.0.190 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthLogin

type AuthLogin struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type CreateMesh

type CreateMesh struct {
	Name string   `json:"name" binding:"required"`
	IPs  []string `json:"ips" binding:"required"`
}

func (*CreateMesh) IsValidHostname

func (r *CreateMesh) IsValidHostname() (bool, string)

type CreateTunnel

type CreateTunnel struct {
	Wireguard bool   `json:"wireguard"`
	Hostname  string `json:"hostname" binding:"required"`
	Password  string `json:"password"`
	IP        string `json:"ip"`
	Client    bool   `json:"client"`
}

func (*CreateTunnel) IsValidHostname

func (r *CreateTunnel) IsValidHostname() (bool, string)

type EditTunnel added in v0.0.75

type EditTunnel struct {
	ID        uint   `json:"id" binding:"required"`
	Wireguard bool   `json:"wireguard" binding:"required"`
	Hostname  string `json:"hostname" binding:"required"`
	Password  string `json:"password"`
	IP        string `json:"ip" binding:"required"`
}

type Host added in v0.0.44

type Host struct {
	Name string `json:"name"`
	IP   string `json:"ip"`
}

type Interface added in v0.0.44

type Interface struct {
	Name string `json:"name"`
	IP   string `json:"ip"`
	MAC  string `json:"mac"`
}

type LQM added in v0.0.44

type LQM struct {
	Enabled bool `json:"enabled"`
}

type LinkInfo added in v0.0.44

type LinkInfo struct {
	HelloTime           uint64  `json:"helloTime"`
	LostLinkTime        uint64  `json:"lostLinkTime"`
	LinkQuality         float32 `json:"linkQuality"`
	VTime               uint64  `json:"vtime"`
	LinkCost            float32 `json:"linkCost"`
	LinkType            string  `json:"linkType"`
	Hostname            string  `json:"hostname"`
	PreviousLinkStatus  string  `json:"previousLinkStatus"`
	CurrentLinkStatus   string  `json:"currentLinkStatus"`
	NeighborLinkQuality float32 `json:"neighborLinkQuality"`
	SymmetryTime        uint64  `json:"symmetryTime"`
	SeqnoValid          bool    `json:"seqnoValid"`
	Pending             bool    `json:"pending"`
	LossHelloInterval   uint64  `json:"lossHelloInterval"`
	LossMultiplier      uint64  `json:"lossMultiplier"`
	Hysteresis          float32 `json:"hysteresis"`
	Seqno               uint64  `json:"seqno"`
	LossTime            uint64  `json:"lossTime"`
	ValidityTime        uint64  `json:"validityTime"`
	OLSRInterface       string  `json:"olsrInterface"`
	LastHelloTime       uint64  `json:"lastHelloTime"`
	AsymmetryTime       uint64  `json:"asymmetryTime"`
}

type MeshRF added in v0.0.44

type MeshRF struct {
	Status string `json:"status"`
}

type NodeDetails added in v0.0.44

type NodeDetails struct {
	MeshSupernode        bool   `json:"mesh_supernode"`
	Description          string `json:"description"`
	Model                string `json:"model"`
	MeshGateway          string `json:"mesh_gateway"`
	BoardID              string `json:"board_id"`
	FirmwareManufacturer string `json:"firmware_mfg"`
	FirmwareVersion      string `json:"firmware_version"`
}

type OlsrdLinkinfo added in v0.0.44

type OlsrdLinkinfo struct {
	HelloTime           uint64  `json:"helloTime"`
	LostLinkTime        uint64  `json:"lostLinkTime"`
	LinkQuality         float32 `json:"linkQuality"`
	VTime               uint64  `json:"vtime"`
	LinkCost            float32 `json:"linkCost"`
	PreviousLinkStatus  string  `json:"previousLinkStatus"`
	CurrentLinkStatus   string  `json:"currentLinkStatus"`
	NeighborLinkQuality float32 `json:"neighborLinkQuality"`
	SymmetryTime        uint64  `json:"symmetryTime"`
	SeqnoValid          bool    `json:"seqnoValid"`
	Pending             bool    `json:"pending"`
	LossHelloInterval   uint64  `json:"lossHelloInterval"`
	LossMultiplier      uint64  `json:"lossMultiplier"`
	Hysteresis          float32 `json:"hysteresis"`
	Seqno               uint64  `json:"seqno"`
	LossTime            uint64  `json:"lossTime"`
	ValidityTime        uint64  `json:"validityTime"`
	OLSRInterface       string  `json:"olsrInterface"`
	LastHelloTime       uint64  `json:"lastHelloTime"`
	AsymmetryTime       uint64  `json:"asymmetryTime"`
	LocalIP             string  `json:"localIP"`
	RemoteIP            string  `json:"remoteIP"`
	InterfaceName       string  `json:"ifName"`
}
type OlsrdLinks struct {
	PID                   int             `json:"pid"`
	SystemTime            uint64          `json:"systemTime"`
	TimeSinceStartup      uint64          `json:"timeSinceStartup"`
	ConfigurationChecksum string          `json:"configurationChecksum"`
	Links                 []OlsrdLinkinfo `json:"links"`
}

type Service added in v0.0.44

type Service struct {
	Name     string `json:"name"`
	IP       string `json:"ip"`
	Protocol string `json:"protocol"`
	Link     string `json:"link"`
}

type Sysinfo added in v0.0.44

type Sysinfo struct {
	Uptime  string     `json:"uptime"`
	Loadavg [3]float64 `json:"loads"`
}

type SysinfoResponse added in v0.0.44

type SysinfoResponse struct {
	Longitude   string              `json:"lon"`
	Latitude    string              `json:"lat"`
	Sysinfo     Sysinfo             `json:"sysinfo"`
	APIVersion  string              `json:"api_version"`
	MeshRF      MeshRF              `json:"meshrf"`
	Gridsquare  string              `json:"grid_square"`
	Node        string              `json:"node"`
	NodeDetails NodeDetails         `json:"node_details"`
	Tunnels     Tunnels             `json:"tunnels"`
	LQM         LQM                 `json:"lqm"`
	Interfaces  []Interface         `json:"interfaces"`
	Hosts       []Host              `json:"hosts"`
	Services    []Service           `json:"services"`
	LinkInfo    map[string]LinkInfo `json:"link_info"`
}

type TunnelWithPass

type TunnelWithPass struct {
	ID             uint      `json:"id"`
	Wireguard      bool      `json:"wireguard"`
	WireguardPort  uint16    `json:"wireguard_port"`
	Client         bool      `json:"client"`
	Hostname       string    `json:"hostname"`
	IP             string    `json:"ip"`
	Password       string    `json:"password"`
	Active         bool      `json:"active"`
	ConnectionTime time.Time `json:"connection_time"`
	CreatedAt      time.Time `json:"created_at"`
}

type Tunnels added in v0.0.44

type Tunnels struct {
	ActiveTunnelCount int `json:"active_tunnel_count"`
}

type UserPatch

type UserPatch struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type UserRegistration

type UserRegistration struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

func (*UserRegistration) IsValidUsername

func (r *UserRegistration) IsValidUsername() (bool, string)

type WebsocketTunnelConnect added in v0.0.149

type WebsocketTunnelConnect struct {
	ID uint `json:"id"`
}

type WebsocketTunnelDisconnect added in v0.0.149

type WebsocketTunnelDisconnect struct {
	ID uint `json:"id"`
}

type WebsocketTunnelStats added in v0.0.149

type WebsocketTunnelStats struct {
	ID               uint    `json:"id"`
	RXBytesPerSecond uint64  `json:"rx_bytes_per_sec"`
	TXBytesPerSecond uint64  `json:"tx_bytes_per_sec"`
	RXBytes          uint64  `json:"rx_bytes"`
	TXBytes          uint64  `json:"tx_bytes"`
	TotalRXMB        float64 `json:"total_rx_mb"`
	TotalTXMB        float64 `json:"total_tx_mb"`
}

type WireguardPubkeyRequest added in v0.0.100

type WireguardPubkeyRequest struct {
	Privkey string `json:"key" binding:"required"`
}

Jump to

Keyboard shortcuts

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