diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-03-20 13:48:47 +0100 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2023-09-25 09:43:37 +0200 |
| commit | 40705474e1998bf4a59b82c96d343e13247a9926 (patch) | |
| tree | b5c69aaab75ad485a2c82e452d98113b78a05b41 /types/types.go | |
| parent | de403deed73340f8068739dc240ebebfa1053872 (diff) | |
Types: Split protocol into its own
Diffstat (limited to 'types/types.go')
| -rw-r--r-- | types/types.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/types/types.go b/types/types.go index 237668b..99b997e 100644 --- a/types/types.go +++ b/types/types.go @@ -4,6 +4,8 @@ package types import ( "encoding/json" "time" + + "github.com/eduvpn/eduvpn-common/types/protocol" ) // TODO: Discovery here is the same as the upstream discovery format, should we separate this as well? @@ -75,21 +77,10 @@ type Expiry struct { NotificationTimes []int64 `json:"notification_times"` } -type Protocol int8 - -const ( - // PROTOCOL_UNKNOWN indicates that the protocol is not known - PROTOCOL_UNKNOWN Protocol = iota - // PROTOCOL_OPENVPN indicates that the protocol is OpenVPN - PROTOCOL_OPENVPN - // PROTOCOL_WIREGUARD indicates that the protocol is WireGuard - PROTOCOL_WIREGUARD -) - type Profile struct { Identifier string `json:"identifier"` DisplayName map[string]string `json:"display_name,omitempty"` - Protocols []Protocol `json:"supported_protocols"` + Protocols []protocol.Protocol `json:"supported_protocols"` } type Profiles struct { @@ -128,7 +119,7 @@ type ServerList struct { type Configuration struct { VPNConfig string `json:"config"` - Protocol Protocol `json:"protocol"` + Protocol protocol.Protocol `json:"protocol"` DefaultGateway bool `json:"default_gateway"` Tokens Tokens `json:"tokens"` } |
