chore: move the go code into a subfolder

This commit is contained in:
Florian Forster
2025-08-05 15:20:32 -07:00
parent 4ad22ba456
commit cd2921de26
2978 changed files with 373 additions and 300 deletions

View File

@@ -0,0 +1,46 @@
package id
const (
DefaultWebhookPath = "http://metadata.google.internal/computeMetadata/v1/instance/id"
)
type Config struct {
// Configuration for the identification of machines.
Identification Identification
}
type Identification struct {
// Configuration for using private IP to identify a machine.
PrivateIp PrivateIp
// Configuration for using hostname to identify a machine.
Hostname Hostname
// Configuration for using a webhook to identify a machine.
Webhook Webhook
}
type PrivateIp struct {
// Try to use private IP when identifying the machine uniquely
Enabled bool
}
type Hostname struct {
// Try to use hostname when identifying the machine uniquely
Enabled bool
}
type Webhook struct {
// Try to use webhook when identifying the machine uniquely
Enabled bool
// The URL of the metadata endpoint to query
Url string
// (Optional) A JSONPath expression for the data to extract from the response from the metadata endpoint
JPath *string
// (Optional) Headers to pass in the metadata request
Headers *map[string]string
}
func Configure(config *Config) {
if config != nil {
GeneratorConfig = config
}
}