refactor: Clean up code and change log format (#719)

This commit is contained in:
TwiN authored and GitHub committed 2024-04-01 21:47:14 -04:00
1 parent 979d467e36
commit 922638e071
19 files changed
+95 -96

No files matched your search

+4 -4
View File
@@ -151,7 +151,7 @@ func (s *SSH) ValidateAndSetDefaults() error {
}
// IsEnabled returns whether the endpoint is enabled or not
func (endpoint Endpoint) IsEnabled() bool {
func (endpoint *Endpoint) IsEnabled() bool {
if endpoint.Enabled == nil {
return true
}
@@ -159,7 +159,7 @@ func (endpoint Endpoint) IsEnabled() bool {
}
// Type returns the endpoint type
func (endpoint Endpoint) Type() EndpointType {
func (endpoint *Endpoint) Type() EndpointType {
switch {
case endpoint.DNS != nil:
return EndpointTypeDNS
@@ -264,7 +264,7 @@ func (endpoint *Endpoint) ValidateAndSetDefaults() error {
}
// DisplayName returns an identifier made up of the Name and, if not empty, the Group.
func (endpoint Endpoint) DisplayName() string {
func (endpoint *Endpoint) DisplayName() string {
if len(endpoint.Group) > 0 {
return endpoint.Group + "/" + endpoint.Name
}
@@ -272,7 +272,7 @@ func (endpoint Endpoint) DisplayName() string {
}
// Key returns the unique key for the Endpoint
func (endpoint Endpoint) Key() string {
func (endpoint *Endpoint) Key() string {
return util.ConvertGroupAndEndpointNameToKey(endpoint.Group, endpoint.Name)
}