summaryrefslogtreecommitdiff
path: root/types/protocol
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-03-20 13:48:47 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2023-09-25 09:43:37 +0200
commit40705474e1998bf4a59b82c96d343e13247a9926 (patch)
treeb5c69aaab75ad485a2c82e452d98113b78a05b41 /types/protocol
parentde403deed73340f8068739dc240ebebfa1053872 (diff)
Types: Split protocol into its own
Diffstat (limited to 'types/protocol')
-rw-r--r--types/protocol/protocol.go23
1 files changed, 23 insertions, 0 deletions
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
+ }
+}