Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Id string `json:"id" bson:"id"` Parent string `json:"parent" bson:"parent"` Email string `json:"email" bson:"email"` Name string `json:"name" bson:"name"` AccountName string `json:"accountName" bson:"accountName"` NetId string `json:"netId" bson:"netId"` NetName string `json:"netName" bson:"netName"` Picture string `json:"picture" bson:"picture"` Role string `json:"role" bson:"role"` Status string `json:"status" bson:"status"` ApiKey string `json:"apiKey" bson:"apiKey"` CreatedBy string `json:"createdBy" bson:"createdBy"` UpdatedBy string `json:"updatedBy" bson:"updatedBy"` Created time.Time `json:"created" bson:"created"` Updated time.Time `json:"updated" bson:"updated"` Networks []*Network `json:"networks" bson:"networks"` VPNs []*VPN `json:"vpns" bson:"vpns"` Devices []*Device `json:"devices" bson:"devices"` }
type AgentNotification ¶
type AgentNotification struct { Type string `json:"type" bson:"type"` Text string `json:"text" bson:"text"` }
AgentNotification structure type: dns, info, error text: message
type Auth ¶
type Auth struct { Oauth2 bool `json:"oauth2"` ClientId string `json:"clientId"` Code string `json:"code"` State string `json:"state"` CodeUrl string `json:"codeUrl"` Redirect string `json:"redirect_uri"` Audience string `json:"audience"` }
Auth structure
type Authentication ¶
type Authentication interface { Setup() error CodeUrl(state string) string CodeUrl2(state string) string Exchange(code string) (*oauth2.Token, error) Exchange2(code string) (*oauth2.Token, error) UserInfo(oauth2Token *oauth2.Token) (*User, error) }
Auth interface to implement as auth provider
type Device ¶
type Device struct { Id string `json:"id" bson:"id"` Server string `json:"server" bson:"server"` ApiKey string `json:"apiKey" bson:"apiKey"` AccountID string `json:"accountid" bson:"accountid"` Name string `json:"name" bson:"name"` Description string `json:"description" bson:"description"` Type string `json:"type,omitempty" bson:"type,omitempty"` Enable bool `json:"enable" bson:"enable"` Tags []string `json:"tags" bson:"tags"` Platform string `json:"platform" bson:"platform"` OS string `json:"os" bson:"os"` Architecture string `json:"arch" bson:"arch"` ClientID string `json:"clientid,omitempty" bson:"clientid,omitempty"` AuthDomain string `json:"authdomain,omitempty" bson:"authdomain,omitempty"` ApiID string `json:"apiid,omitempty" bson:"apiid,omitempty"` AppData string `json:"appdata,omitempty" bson:"appdata,omitempty"` CheckInterval int64 `json:"checkInterval" bson:"checkInterval"` ServiceGroup string `json:"serviceGroup,omitempty" bson:"serviceGroup,omitempty"` ServiceApiKey string `json:"serviceApiKey,omitempty" bson:"serviceApiKey,omitempty"` SourceAddress string `json:"sourceAddress,omitempty" bson:"sourceAddress,omitempty"` Debug bool `json:"debug,omitempty" bson:"debug,omitempty"` Quiet bool `json:"quiet,omitempty" bson:"quiet,omitempty"` Registered bool `json:"registered" bson:"registered"` UpdateKeys bool `json:"updateKeys" bson:"updateKeys"` Version string `json:"version" bson:"version"` InstanceID string `json:"instanceid,omitempty" bson:"instanceid,omitempty"` EZCode string `json:"ezcode,omitempty" bson:"ezcode,omitempty"` CreatedBy string `json:"createdBy" bson:"createdBy"` UpdatedBy string `json:"updatedBy" bson:"updatedBy"` Created time.Time `json:"created" bson:"created"` Updated time.Time `json:"updated" bson:"updated"` LastSeen *time.Time `json:"lastSeen,omitempty" bson:"lastSeen,omitempty"` VPNs []*VPN `json:"vpns,omitempty" bson:"vpns,omitempty"` }
Device structure swagger:model Device Defines the device model
type Limits ¶
type Limits struct { Id string `json:"id" bson:"id"` AccountID string `json:"accountid" bson:"accountid"` Devices int `json:"devices" bson:"devices"` MaxDevices int `json:"maxdevices" bson:"maxdevices"` Networks int `json:"networks" bson:"networks"` MaxNetworks int `json:"maxnetworks" bson:"maxnetworks"` Members int `json:"members" bson:"members"` MaxMembers int `json:"maxmembers" bson:"maxmembers"` Services int `json:"services" bson:"services"` MaxServices int `json:"maxservices" bson:"maxservices"` Tolerance float64 `json:"tolerance" bson:"tolerance"` CreatedBy string `json:"createdBy" bson:"createdBy"` UpdatedBy string `json:"updatedBy" bson:"updatedBy"` Created time.Time `json:"created" bson:"created"` Updated time.Time `json:"updated" bson:"updated"` }
func (Limits) DevicesLimitReached ¶
func (Limits) MembersLimitReached ¶
func (Limits) NetworksLimitReached ¶
func (Limits) RelaysLimitReached ¶
type Message ¶
type Message struct { Id string `json:"id" bson:"id"` Device *Device `json:"device" bson:"device"` Config []VPNConfig `json:"config" bson:"config"` }
Host structure
type Network ¶
type Network struct { Id string `json:"id" bson:"id"` AccountID string `json:"accountid" bson:"accountid"` NetName string `json:"netName" bson:"netName"` Description string `json:"description" bson:"description"` Tags []string `json:"tags" bson:"tags"` CreatedBy string `json:"createdBy" bson:"createdBy"` UpdatedBy string `json:"updatedBy" bson:"updatedBy"` Created *time.Time `json:"created" bson:"created"` Updated *time.Time `json:"updated" bson:"updated"` ForceUpdate bool `json:"forceUpdate" bson:"forceUpdate"` Critical bool `json:"critical" bson:"critical"` Policies Policies `json:"policies" bson:"policies"` Default *Settings `json:"default" bson:"default"` }
Network structure
type OAuth2Token ¶
type Server ¶
type Server struct { Id string `json:"id" bson:"id"` Name string `json:"name" bson:"name"` Description string `json:"description" bson:"description"` IpAddress string `json:"ipAddress" bson:"ipAddress"` PortMin int `json:"portMin" bson:"portMin"` PortMax int `json:"portMax" bson:"portMax"` ServiceGroup string `json:"serviceGroup" bson:"serviceGroup"` ServiceApiKey string `json:"serviceApiKey" bson:"serviceApiKey"` DefaultSubnet string `json:"defaultSubnet" bson:"defaultSubnet"` }
Server structure
type Service ¶
type Service struct { Id string `json:"id" bson:"id"` ServiceGroup string `json:"serviceGroup" bson:"serviceGroup"` ApiKey string `json:"apikey" bson:"apikey"` AccountID string `json:"accountid" bson:"accountid"` Email string `json:"email" bson:"email"` SubscriptionId string `json:"subscriptionid" bson:"subscriptionid"` Created time.Time `json:"created" bson:"created"` Updated time.Time `json:"updated" bson:"updated"` CreatedBy string `json:"createdBy" bson:"createdBy"` UpdatedBy string `json:"updatedBy" bson:"updatedBy"` Device *Device `json:"device" bson:"device"` Net *Network `json:"net" bson:"net"` VPN *VPN `json:"vpn" bson:"vpn"` ContainerId string `json:"containerid" bson:"containerid"` Status string `json:"status" bson:"status"` IpAddress string `json:"ipAddress" bson:"ipAddress"` Name string `json:"name" bson:"name"` Description string `json:"description" bson:"description"` ServiceType string `json:"serviceType" bson:"serviceType"` ServicePort int `json:"servicePort" bson:"servicePort"` DefaultSubnet string `json:"defaultSubnet" bson:"defaultSubnet"` }
Net structure
type ServiceMessage ¶
type Settings ¶
type Settings struct { PrivateKey string `json:"privateKey" bson:"privateKey"` PublicKey string `json:"publicKey" bson:"publicKey"` AllowedIPs []string `json:"allowedIPs" bson:"allowedIPs"` Address []string `json:"address" bson:"address"` Dns []string `json:"dns" bson:"dns"` Table string `json:"table,omitempty" bson:"table,omitempty"` PersistentKeepalive int `json:"persistentKeepalive" bson:"persistentKeepalive"` ListenPort int `json:"listenPort" bson:"listenPort"` Endpoint string `json:"endpoint" bson:"endpoint"` Mtu int `json:"mtu" bson:"mtu"` SubnetRouting bool `json:"subnetRouting,omitempty" bson:"subnetRouting,omitempty"` UPnP bool `json:"upnp,omitempty" bson:"upnp,omitempty"` SyncEndpoint bool `json:"syncEndpoint,omitempty" bson:"syncEndpoint,omitempty"` FailSafe bool `json:"failsafe,omitempty" bson:"failsafe,omitempty"` EnableDns bool `json:"enableDns,omitempty" bson:"enableDns,omitempty"` HasSSH bool `json:"hasSSH,omitempty" bson:"hasSSH,omitempty"` HasRDP bool `json:"hasRDP,omitempty" bson:"hasRDP,omitempty"` PreUp string `json:"preUp,omitempty" bson:"preUp,omitempty"` PostUp string `json:"postUp,omitempty" bson:"postUp,omitempty"` PreDown string `json:"preDown,omitempty" bson:"preDown,omitempty"` PostDown string `json:"postDown,omitempty" bson:"postDown,omitempty"` }
Host structure
type StatusResponse ¶
type Subscription ¶
type Subscription struct { Id string `json:"id" bson:"id"` AccountID string `json:"accountid" bson:"accountid"` Email string `json:"email" bson:"email"` Name string `json:"name" bson:"name"` Description string `json:"description" bson:"description"` Issued *time.Time `json:"issued" bson:"issued"` Expires *time.Time `json:"expires" bson:"expires"` LastUpdated *time.Time `json:"lastUpdated" bson:"lastUpdated"` CreatedBy string `json:"createdBy" bson:"createdBy"` UpdatedBy string `json:"updatedBy" bson:"updatedBy"` Status string `json:"status" bson:"status"` Sku string `json:"sku" bson:"sku"` Credits int `json:"credits" bson:"credits"` AutoRenew bool `json:"autoRenew" bson:"autoRenew"` }
Net structure
func (Subscription) IsValid ¶
func (s Subscription) IsValid() []error
IsValid check if model is valid
type User ¶
type User struct { Sub string `json:"sub" bson:"sub"` Name string `json:"name" bson:"name"` Email string `json:"email" bson:"email"` AccountID string `json:"accountid" bson:"accountid"` Profile string `json:"profile" bson:"profile"` Picture string `json:"picture" bson:"picture"` Issuer string `json:"issuer" bson:"issuer"` Plan string `json:"plan" bson:"plan"` IssuedAt time.Time `json:"issuedAt" bson:"issuedAt"` CreatedBy string `json:"createdBy" bson:"createdBy"` Created time.Time `json:"created_at" bson:"created_at"` UpdatedBy string `json:"updatedBy" bson:"updatedBy"` Updated time.Time `json:"updated_at" bson:"updated_at"` }
User structure
type VPN ¶
type VPN struct { Id string `json:"id" bson:"id"` AccountID string `json:"accountid" bson:"accountid"` DeviceID string `json:"deviceid" bson:"deviceid"` Name string `json:"name" bson:"name"` NetId string `json:"netid" bson:"netid"` NetName string `json:"netName" bson:"netName"` Role string `json:"role,omitempty" bson:"role,omitempty"` Type string `json:"type,omitempty" bson:"type,omitempty"` Failover int `json:"failover" bson:"failover"` FailCount int `json:"failCount" bson:"failCount"` Enable bool `json:"enable" bson:"enable"` Tags []string `json:"tags" bson:"tags"` CreatedBy string `json:"createdBy" bson:"createdBy"` UpdatedBy string `json:"updatedBy" bson:"updatedBy"` Created *time.Time `json:"created" bson:"created"` Updated *time.Time `json:"updated" bson:"updated"` Current *Settings `json:"current,omitempty" bson:"current,omitempty"` Default *Settings `json:"default,omitempty" bson:"default,omitempty"` Devices []*Device `json:"devices,omitempty" bson:"devices,omitempty"` }
VPN structure
Click to show internal directories.
Click to hide internal directories.