 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func CheckSpec(tuning Tuning) error
- func Collection(name string) string
- func DB() string
- func GetLocal() *sync.Map
- func GetRolesToHandle(tuningName string) ([]*nodes.Role, bool)
- func GetSpecs() *sync.Map
- func ReqCollection() string
- func SetLocal(tuning Tuning)
- func SetSpec(name string, spec *Spec)
- type Limitation
- type ListOptions
- type Policy
- type RawLimitation
- type RawSpec
- type Reset
- type Spec
- type Toggle
- type Tuning
- func (t *Tuning) Bytes() ([]byte, error)
- func (t *Tuning) CopyAndOverrideHost(n nodes.Node) Tuning
- func (t *Tuning) GenSearchableOject() Tuning
- func (t *Tuning) GenSortIndex() string
- func (t *Tuning) GenTaskUpdate() Tuning
- func (t *Tuning) GenerateId() string
- func (t *Tuning) IncludeHost(hostname string) bool
- func (t *Tuning) IncludeHosts(hosts []string) bool
- func (t *Tuning) IndexKey() string
- func (t *Tuning) InitHosts(hosts []string)
- func (t *Tuning) InitResetStatus()
- func (t *Tuning) InitStatus(current, desired string)
- func (t *Tuning) InitUpdateStatus()
- func (t *Tuning) JoinHosts() string
- func (t *Tuning) SetCompleted()
- func (t *Tuning) SetDesired(status string)
- func (t *Tuning) SetError()
- func (t *Tuning) SetNodeInfo(role, address string)
- func (t *Tuning) SetOk()
- func (t *Tuning) SetUpdated()
- func (t *Tuning) SetUpdating()
- func (t *Tuning) StrValue() string
 
- type Update
Constants ¶
      View Source
      
  
const ( Module = "tunings" RecordTTL = 3600 )
Variables ¶
Functions ¶
func Collection ¶
func ReqCollection ¶
func ReqCollection() string
Types ¶
type Limitation ¶
type ListOptions ¶
type ListOptions struct {
	AllNodes bool
}
    type Policy ¶
type Policy struct {
	Name    string   `json:"name" yaml:"name"`
	Version string   `json:"version" yaml:"version"`
	Enabled bool     `json:"enabled" yaml:"enabled"`
	Tunings []Tuning `json:"tunings" yaml:"tunings"`
}
    func (*Policy) AppendTuning ¶
func (*Policy) AppendTunings ¶
func (*Policy) DeleteTuning ¶
func (*Policy) HasMatchedTuning ¶
func (*Policy) UpdateOrAppendTuning ¶
type RawLimitation ¶
type RawSpec ¶
type RawSpec struct {
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Limitation  RawLimitation `json:"limitation"`
}
    type Spec ¶
type Spec struct {
	Name           string        `json:"name"`
	Description    string        `json:"description"`
	Limitation     Limitation    `json:"limitation"`
	Roles          []*nodes.Role `json:"roles"`
	nodes.Selector `json:"-"`
}
    func (*Spec) IsInLimitedRange ¶
type Tuning ¶
type Tuning struct {
	Id          string     `json:"id,omitempty" yaml:"-" bson:"id"`
	Name        string     `json:"name" yaml:"name" bson:"name"`
	Value       any        `json:"value" yaml:"value" bson:"value"`
	Description string     `json:"description" yaml:"-" bson:"-"`
	Enabled     bool       `json:"enabled" yaml:"enabled" bson:"enabled"`
	IsModified  bool       `json:"isModified" yaml:"-" bson:"-"`
	Limitation  Limitation `json:"limitation" yaml:"-" bson:"-"`
	SortIndex   string     `json:"-" yaml:"-" bson:"-"`
	Node   *nodes.Node    `json:"node,omitempty" yaml:"-" bson:"-"`
	Hosts  []nodes.Host   `json:"hosts" yaml:"-" bson:"-"`
	Roles  []nodes.Role   `json:"roles,omitempty" yaml:"-" bson:"-"`
	Status *status.Tuning `json:"status,omitempty" yaml:"-" bson:"status,omitempty"`
}
    func (*Tuning) GenSearchableOject ¶
func (*Tuning) GenSortIndex ¶
func (*Tuning) GenTaskUpdate ¶
func (*Tuning) GenerateId ¶
func (*Tuning) IncludeHost ¶
func (*Tuning) IncludeHosts ¶
func (*Tuning) InitResetStatus ¶
func (t *Tuning) InitResetStatus()
func (*Tuning) InitStatus ¶
func (*Tuning) InitUpdateStatus ¶
func (t *Tuning) InitUpdateStatus()
func (*Tuning) SetCompleted ¶
func (t *Tuning) SetCompleted()
func (*Tuning) SetDesired ¶
func (*Tuning) SetNodeInfo ¶
func (*Tuning) SetUpdated ¶
func (t *Tuning) SetUpdated()
func (*Tuning) SetUpdating ¶
func (t *Tuning) SetUpdating()
 Click to show internal directories. 
   Click to hide internal directories.