Documentation
¶
Index ¶
- type Account
- type AccountUpdate
- type AddRequest
- type CheckSystemUpdate
- type DpiStat
- type DpiStats
- type DpiStatsRequest
- type LoginRequest
- type LoginResponse
- type MwanEvent
- type MwanEventRequest
- type MwanEvents
- type OTPJson
- type OpenVPNConfiguration
- type OpenVPNConfigurations
- type OvpnRwConnection
- type OvpnRwConnections
- type OvpnRwConnectionsRequest
- type PasswordChange
- type PlatformInfo
- type RegisterRequest
- type SSHGenerate
- type TsAttack
- type TsAttackRequest
- type TsAttacks
- type TsMalware
- type TsMalwareRequest
- type TsMalwares
- type UbusCommand
- type UbusResponse
- type Unit
- type UnitGroup
- type UnitInfo
- type UnitNameRequest
- type UnitOpenVPNRWRequest
- type UnitWanRequest
- type Wan
- type Wans
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID int `json:"id" structs:"id"`
Username string `json:"username" structs:"username" binding:"required,excludesall= "`
Password string `json:"password" structs:"password" db:"-" binding:"required"`
// Watch out: un/marshalling booleans is a pain, see https://github.com/gin-gonic/gin/issues/814
Admin bool `json:"admin" structs:"admin"`
DisplayName string `json:"display_name" structs:"display_name"`
UnitGroups []int `json:"unit_groups" structs:"unit_groups"`
Created time.Time `json:"created" structs:"created_at"`
Updated time.Time `json:"updated" structs:"updated_at"`
TwoFA bool `json:"two_fa" structs:"two_fa"`
}
type AccountUpdate ¶
type AddRequest ¶
type AddRequest struct {
UnitId string `json:"unit_id" binding:"required"`
}
type CheckSystemUpdate ¶
type DpiStat ¶
type DpiStat struct {
Timestamp int64 `json:"timestamp" binding:"required"`
ClientAddress string `json:"client_address" binding:"required"`
ClientName string `json:"client_name" binding:"required"`
Protocol string `json:"protocol"`
Host string `json:"host"`
Application string `json:"application"`
Bytes int64 `json:"bytes" binding:"required"`
}
type DpiStatsRequest ¶
type DpiStatsRequest struct {
Data DpiStats `json:"data" binding:"required"`
}
type LoginRequest ¶
type LoginResponse ¶
type MwanEventRequest ¶
type MwanEventRequest struct {
Data MwanEvents `json:"data" binding:"required"`
}
type MwanEvents ¶
type MwanEvents []MwanEvent
type OpenVPNConfiguration ¶
type OpenVPNConfiguration struct {
Instance string `json:"instance" binding:"required"`
Name string `json:"name" binding:"required"`
Device string `json:"device" binding:"required"`
Type string `json:"type"` // valid values are: rw (for roadwarrior), client (for tunnel client), server (for tunnel server)
}
type OpenVPNConfigurations ¶
type OpenVPNConfigurations []OpenVPNConfiguration
type OvpnRwConnection ¶
type OvpnRwConnection struct {
Timestamp int64 `json:"timestamp" binding:"required"`
Instance string `json:"instance" binding:"required"`
CommonName string `json:"common_name" binding:"required"`
VirtualIpAddr string `json:"virtual_ip_addr" binding:"required"`
RemoteIpAddr string `json:"remote_ip_addr" binding:"required"`
StartTime int64 `json:"start_time" binding:"required"`
Duration int64 `json:"duration" binding:"required"`
BytesReceived int64 `json:"bytes_received" binding:"required"`
BytesSent int64 `json:"bytes_sent" binding:"required"`
}
type OvpnRwConnections ¶
type OvpnRwConnections []OvpnRwConnection
type OvpnRwConnectionsRequest ¶
type OvpnRwConnectionsRequest struct {
Data OvpnRwConnections `json:"data" binding:"required"`
}
type PasswordChange ¶
type PlatformInfo ¶
type PlatformInfo struct {
VpnPort string `json:"vpn_port" structs:"vpn_port"`
VpnNetwork string `json:"vpn_network" structs:"vpn_network"`
ControllerVersion string `json:"controller_version" structs:"controller_version"`
MetricsRetentionDays int `json:"metrics_retention_days" structs:"metrics_retention_days"`
LogsRetentionDays int `json:"logs_retention_days" structs:"logs_retention_days"`
}
type RegisterRequest ¶
type RegisterRequest struct {
UnitId string `json:"unit_id" binding:"required"`
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
UnitName string `json:"unit_name" binding:"required"`
Version string `json:"version"`
SubscriptionType string `json:"subscription_type"`
SystemId string `json:"system_id"`
}
type SSHGenerate ¶
type SSHGenerate struct {
Passphrase string `json:"passphrase" binding:"required"`
}
type TsAttackRequest ¶
type TsAttackRequest struct {
Data TsAttacks `json:"data" binding:"required"`
}
type TsMalwareRequest ¶
type TsMalwareRequest struct {
Data TsMalwares `json:"data" binding:"required"`
}
type TsMalwares ¶
type TsMalwares []TsMalware
type UbusCommand ¶
type UbusResponse ¶
type UbusResponse[T any] struct { Code int `json:"code"` Data T `json:"data"` Message string `json:"message"` }
Response example: {"code":200,"data":{"depends": "on the call"},"message":"ubus call action success"}
type Unit ¶
type Unit struct {
ID string `json:"unit_id" structs:"id"`
Name string `json:"unit_name" structs:"name"`
Version string `json:"version" structs:"version"`
SubscriptionType string `json:"subscription_type" structs:"subscription_type"`
SystemID string `json:"system_id" structs:"system_id"`
Created time.Time `json:"created" structs:"created"`
}
type UnitGroup ¶
type UnitGroup struct {
ID int `json:"id" structs:"id"`
Name string `json:"name" structs:"name"`
Description string `json:"description" structs:"description"`
Units []string `json:"units" structs:"units"`
CreatedAt time.Time `json:"created_at" structs:"created_at"`
UpdatedAt time.Time `json:"updated_at" structs:"updated_at"`
UsedBy []string `json:"used_by" structs:"used_by"`
}
type UnitInfo ¶
type UnitInfo struct {
UnitName string `json:"unit_name"`
Version string `json:"version"`
VersionUpdate string `json:"version_update"`
ScheduledUpdate int `json:"scheduled_update"`
SubscriptionType string `json:"subscription_type"`
SystemID string `json:"system_id"`
SSHPort int `json:"ssh_port"`
FQDN string `json:"fqdn"`
APIVersion string `json:"api_version"`
Description string `json:"description"`
}
type UnitNameRequest ¶
type UnitNameRequest struct {
Name string `json:"name" binding:"required"`
}
type UnitOpenVPNRWRequest ¶
type UnitOpenVPNRWRequest struct {
Data OpenVPNConfigurations `json:"data" binding:"required"`
}
type UnitWanRequest ¶
type UnitWanRequest struct {
Data Wans `json:"data" binding:"required"`
}
Click to show internal directories.
Click to hide internal directories.