-
-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(remote): Implement lazy distributed feature (#64)
THIS IS AN EXPERIMENTAL FEATURE/IMPLEMENTATION, AND IT MAY BE REMOVED IN THE FUTURE. Note that for now, it will be an undocumented feature.
- Loading branch information
Showing
13 changed files
with
164 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package remote | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/TwiN/gatus/v4/client" | ||
) | ||
|
||
// NOTICE: This is an experimental alpha feature and may be updated/removed in future versions. | ||
// For more information, see https://github.com/TwiN/gatus/issues/64 | ||
|
||
type Config struct { | ||
// Instances is a list of remote instances to retrieve endpoint statuses from. | ||
Instances []Instance `yaml:"instances,omitempty"` | ||
|
||
// ClientConfig is the configuration of the client used to communicate with the provider's target | ||
ClientConfig *client.Config `yaml:"client,omitempty"` | ||
} | ||
|
||
type Instance struct { | ||
EndpointPrefix string `yaml:"endpoint-prefix"` | ||
URL string `yaml:"url"` | ||
} | ||
|
||
func (c *Config) ValidateAndSetDefaults() error { | ||
if c.ClientConfig == nil { | ||
c.ClientConfig = client.GetDefaultConfig() | ||
} else { | ||
if err := c.ClientConfig.ValidateAndSetDefaults(); err != nil { | ||
return err | ||
} | ||
} | ||
if len(c.Instances) > 0 { | ||
log.Println("WARNING: Your configuration is using 'remote', which is in alpha and may be updated/removed in future versions.") | ||
log.Println("WARNING: See https://github.com/TwiN/gatus/issues/64 for more information") | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.