From 40705474e1998bf4a59b82c96d343e13247a9926 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Mon, 20 Mar 2023 13:48:47 +0100 Subject: Types: Split protocol into its own --- types/protocol/protocol.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 types/protocol/protocol.go (limited to 'types/protocol') diff --git a/types/protocol/protocol.go b/types/protocol/protocol.go new file mode 100644 index 0000000..d165105 --- /dev/null +++ b/types/protocol/protocol.go @@ -0,0 +1,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 + } +} -- cgit v1.2.3