profiles

package
v0.0.0-...-0b96de9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package profiles defines a wrapper around the various profiles returned by the /info endpoint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Info ListInfo `json:"info"`
}

Info is the top-level struct for the info endpoint

func (Info) Get

func (i Info) Get(id string) *Profile

Get returns a profile with id `id`, it returns nil if it is not found

func (Info) Len

func (i Info) Len() int

Len returns the length of the profile list

func (Info) MustIndex

func (i Info) MustIndex(n int) Profile

MustIndex gets a profile by index This index must be in the bounds

func (Info) Public

func (i Info) Public() server.Profiles

Public gets the server list as a structure that we return to clients

type ListInfo

type ListInfo struct {
	ProfileList []Profile `json:"profile_list"`
}

ListInfo is the struct that has the profile list

type Profile

type Profile struct {
	// ID is the identifier of the profile
	// Used to select a profile
	ID string `json:"profile_id"`
	// DisplayName defines the UI friendly name for the profile
	DisplayName string `json:"display_name"`
	// VPNProtoList defines the list of VPN protocols
	// E.g. wireguard, openvpn
	VPNProtoList []string `json:"vpn_proto_list"`
	// VPNProtoTransportList defines the list of VPN protocols including their transport values
	// E.g. wireguard+udp, openvpn+tcp
	VPNProtoTransportList []string `json:"vpn_proto_transport_list"`
	// DefaultGateway specifies whether or not this profile is a default gateway profile
	DefaultGateway bool `json:"default_gateway"`
	// DNSSearchDomains specifies the list of dns search domains
	// This is provided for a Linux client issue
	// See: https://github.com/eduvpn/python-eduvpn-client/issues/550
	DNSSearchDomains []string `json:"dns_search_domain_list"`
	// Priority is the priority of the profile for sorting in the UI
	// the higher the priority, the higher it should be in the list
	Priority int `json:"profile_priority"`
}

Profile is the information for a profile

func (*Profile) HasOpenVPN

func (p *Profile) HasOpenVPN() bool

HasOpenVPN returns whether or not the profile has OpenVPN support

func (*Profile) HasWireGuard

func (p *Profile) HasWireGuard() bool

HasWireGuard returns whether or not the profile has WireGuard support

func (*Profile) ShouldFailover

func (p *Profile) ShouldFailover() bool

ShouldFailover returns whether or not this VPN profile should start a failover procedure This is true when the profile supports a TCP connection If we cannot determine whether it supports a TCP connection (because the server doesn't provide the VPN transport list function yet), we will just check if it supports OpenVPN

Jump to

Keyboard shortcuts

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