model

package
v0.0.0-...-14a4c8a Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const WakeOnLanHostCollectionName = "wake_on_lan_hosts"

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseData

type BaseData struct {
	Active      string
	CurrentUser string
	Admin       bool
}

BaseData struct to pass value to the base template

type Client

type Client struct {
	ID              string    `json:"id"`
	PrivateKey      string    `json:"private_key"`
	PublicKey       string    `json:"public_key"`
	PresharedKey    string    `json:"preshared_key"`
	Name            string    `json:"name"`
	Email           string    `json:"email"`
	Telegram        string    `json:"telegram"`
	AllocatedIPs    []string  `json:"allocated_ips"`
	AllowedIPs      []string  `json:"allowed_ips"`
	ExtraAllowedIPs []string  `json:"extra_allowed_ips"`
	UseServerDNS    bool      `json:"use_server_dns"`
	Enabled         bool      `json:"enabled"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
	PaymentDate     time.Time `json:"client_data_payment"`
}

Client model

type ClientData

type ClientData struct {
	Client *Client
	QRCode string
}

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

type ClientServerHashes struct {
	Client string `json:"client"`
	Server string `json:"server"`
}

ClientServerHashes struct, to save hashes to detect changes

type GlobalSetting

type GlobalSetting struct {
	EndpointAddress     string    `json:"endpoint_address"`
	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"`
	RemoteAPI           string    `json:"remote_api"`
	UpdatedAt           time.Time `json:"updated_at"`
	TelegramChat        int64     `json:"telegram_chat"`
	TelegramToken       string    `json:"telegram_token"`
}

GlobalSetting model

type Interface

type Interface struct {
	Name      string `json:"name"`
	IPAddress string `json:"ip_address"`
}

Interface model

type Peer

type Peer struct {
	PublicKey       string    `json:"public_key"`
	HasPresharedKey bool      `json:"has_preshared_key"`
	Endpoint        string    `json:"endpoint"`
	LastHandshake   time.Time `json:"last_handshake"`
	ReceiveBytes    int64     `json:"receive_bytes"`
	TransmitBytes   int64     `json:"transmit_bytes"`
	AllowedIPs      []string  `json:"allowed_ips"`
	ProtocolVersion int       `json:"protocol_version"`
}

type QRCodeSettings

type QRCodeSettings struct {
	Enabled    bool
	IncludeDNS bool
	IncludeMTU bool
}

type Server

type Server struct {
	KeyPair   *ServerKeypair
	Interface *ServerInterface
}

Server model

type ServerInterface

type ServerInterface struct {
	Addresses  []string  `json:"addresses"`
	ListenPort int       `json:"listen_port,string"` // ,string to get listen_port string input as int
	UpdatedAt  time.Time `json:"updated_at"`
	PostUp     string    `json:"post_up"`
	PostDown   string    `json:"post_down"`
}

ServerInterface model

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"`
	Password string `json:"password"`
	// PasswordHash takes precedence over Password.
	PasswordHash string `json:"password_hash"`
	Admin        bool   `json:"admin"`
}

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)

Jump to

Keyboard shortcuts

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