Documentation
¶
Index ¶
Constants ¶
View Source
const WakeOnLanHostCollectionName = "wake_on_lan_hosts"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
ID string `json:"id"`
PrivateKey string `json:"private_key"`
PublicKey string `json:"public_key"`
Name string `json:"name"`
TgUserid string `json:"telegram_userid"`
Email string `json:"email"`
SubnetRanges []string `json:"subnet_ranges,omitempty"`
AllocatedIPs []string `json:"allocated_ips"`
AllowedIPs []string `json:"allowed_ips"`
ExtraAllowedIPs []string `json:"extra_allowed_ips"`
Endpoint string `json:"endpoint"`
AdditionalNotes string `json:"additional_notes"`
UseServerDNS bool `json:"use_server_dns"`
Enabled bool `json:"enabled"`
CreatedBy string `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Quota int64 `json:"quota,omitempty"`
UsedQuota int64 `json:"used_quota,omitempty"`
Expiration time.Time `json:"expiration,omitempty"`
ExpirationDays int `json:"expiration_days,omitempty"`
FirstConnectedAt time.Time `json:"first_connected_at,omitempty"`
Status string `json:"status,omitempty"`
LastHandshake time.Time `json:"last_handshake,omitempty"`
// Persistent storage for usage data
PersistentUsageData *ClientUsageData `json:"persistent_usage_data,omitempty"`
}
Client model
type ClientData ¶
ClientData includes the Client and extra data
type ClientDefaults ¶
type ClientDefaults struct {
AllowedIps []string
ExtraAllowedIps []string
UseServerDNS bool
EnableAfterCreation bool
}
ClientDefaults Defaults for creation of new clients used in the templates
type ClientServerHashes ¶
ClientServerHashes struct, to save hashes to detect changes
type ClientUsageData ¶
type ClientUsageData struct {
TotalBytesReceived uint64 `json:"total_bytes_received"`
TotalBytesSent uint64 `json:"total_bytes_sent"`
LastInterfaceBytesReceived uint64 `json:"last_interface_bytes_received"`
LastInterfaceBytesSent uint64 `json:"last_interface_bytes_sent"`
LastSeen time.Time `json:"last_seen"`
FirstSeen time.Time `json:"first_seen"`
UpdatedAt time.Time `json:"updated_at"`
}
ClientUsageData stores persistent usage information
type GlobalSetting ¶
type GlobalSetting struct {
EndpointAddress string `json:"endpoint_address"`
RelayEndpoint string `json:"relay_endpoint"`
DNSServers []string `json:"dns_servers"`
MTU int `json:"mtu,string"`
PersistentKeepalive int `json:"persistent_keepalive,string"`
FirewallMark string `json:"firewall_mark"`
Table string `json:"table"`
ConfigFilePath string `json:"config_file_path"`
AppSecretToken string `json:"app_secret_token"`
UpdatedAt time.Time `json:"updated_at"`
// Display settings
Timezone string `json:"timezone"`
Language string `json:"language"`
}
GlobalSetting model
type QRCodeSettings ¶
type ServerInterface ¶
type ServerInterface struct {
Addresses []string `json:"addresses"`
ListenPort int `json:"listen_port"`
UpdatedAt time.Time `json:"updated_at"`
PostUp string `json:"post_up"`
PreDown string `json:"pre_down"`
PostDown string `json:"post_down"`
// فیلد جدید برای فاصله بررسی (بر حسب دقیقه)
CheckInterval int `json:"check_interval"`
}
ServerInterface model
func (*ServerInterface) UnmarshalJSON ¶
func (s *ServerInterface) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom decoding to allow listen_port and check_interval to be provided as either strings or numbers.
type ServerKeypair ¶
type ServerKeypair struct {
PrivateKey string `json:"private_key"`
PublicKey string `json:"public_key"`
UpdatedAt time.Time `json:"updated_at"`
}
ServerKeypair model
type User ¶
type User struct {
Username string `json:"username"`
PasswordHash string `json:"password_hash"`
Role UserRole `json:"role"`
APIToken string `json:"api_token,omitempty"`
TokenExpire time.Time `json:"token_expire,omitempty"`
}
User model
type WakeOnLanHost ¶
type WakeOnLanHost struct {
MacAddress string `json:"MacAddress"`
Name string `json:"Name"`
LatestUsed *time.Time `json:"LatestUsed"`
}
func (WakeOnLanHost) ResolveResourceName ¶
func (host WakeOnLanHost) ResolveResourceName() (string, error)
Click to show internal directories.
Click to hide internal directories.