0
0
Fork 0
mirror of https://github.com/crazy-max/diun.git synced 2025-01-27 01:08:50 +00:00
crazy-max_diun/internal/model/provider_nomad.go
Ian Fijolek 6318e4f069
Add Nomad provider
I modeled it off the Kubernetes provider a bit. It supports setting task
config at group and task levels using services and meta attributes.
2022-12-27 17:35:27 +01:00

28 lines
985 B
Go

package model
import (
"github.com/crazy-max/diun/v4/pkg/utl"
)
// PrdNomad holds nomad provider configuration
type PrdNomad struct {
Address string `yaml:"address" json:"address,omitempty" validate:"omitempty"`
Region string `yaml:"region,omitempty" json:"region,omitempty" validate:"omitempty"`
SecretID string `yaml:"secretID,omitempty" json:"secretID,omitempty" validate:"omitempty"`
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty" validate:"omitempty"`
TLSInsecure *bool `yaml:"tlsInsecure" json:"tlsInsecure,omitempty" validate:"required"`
WatchByDefault *bool `yaml:"watchByDefault" json:"watchByDefault,omitempty" validate:"required"`
}
// GetDefaults gets the default values
func (s *PrdNomad) GetDefaults() *PrdNomad {
n := &PrdNomad{}
n.SetDefaults()
return n
}
// SetDefaults sets the default values
func (s *PrdNomad) SetDefaults() {
s.TLSInsecure = utl.NewFalse()
s.WatchByDefault = utl.NewFalse()
}