summaryrefslogtreecommitdiff
path: root/types/protocol/protocol.go
blob: 6e003f766e2790f549257952435286afa3563ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package protocol

type Protocol int8

const (
	// Unknown indicates that the protocol is not known
	Unknown Protocol = iota
	// OpenVPN indicates that the protocol is OpenVPN
	OpenVPN
	// WireGuard indicates that the protocol is WireGuard
	WireGuard
)

func New(p string) Protocol {
	switch p {
	case "openvpn":
		return OpenVPN
	case "wireguard":
		return WireGuard
	default:
		return Unknown
	}
}