Documentation ¶
Index ¶
- type BasePriority
- func (b *BasePriority) Map(u *core.Unit, c core.Candidater) (core.HostPriority, error)
- func (b *BasePriority) Name() string
- func (b *BasePriority) PreExecute(u *core.Unit, cs []core.Candidater) (bool, []core.PredicateFailureReason, error)
- func (b *BasePriority) Reduce(u *core.Unit, cs []core.Candidater, result core.HostPriorityList) error
- func (b *BasePriority) ScoreIntervals() score.Intervals
- type PriorityHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasePriority ¶
type BasePriority struct { }
BasePriority is a default struct for priority that all the priorities will contain it and implement its PreExecute(),Map(),Reduce() and Name() methods.
func (*BasePriority) Map ¶
func (b *BasePriority) Map(u *core.Unit, c core.Candidater) (core.HostPriority, error)
func (*BasePriority) Name ¶
func (b *BasePriority) Name() string
func (*BasePriority) PreExecute ¶
func (b *BasePriority) PreExecute(u *core.Unit, cs []core.Candidater) (bool, []core.PredicateFailureReason, error)
func (*BasePriority) Reduce ¶
func (b *BasePriority) Reduce(u *core.Unit, cs []core.Candidater, result core.HostPriorityList) error
func (*BasePriority) ScoreIntervals ¶
func (b *BasePriority) ScoreIntervals() score.Intervals
type PriorityHelper ¶
type PriorityHelper struct { Candidate core.Candidater // contains filtered or unexported fields }
PriorityHelper is a struct that as a base interface for all priorities.
func NewPriorityHelper ¶
func NewPriorityHelper(p core.Priority, u *core.Unit, c core.Candidater) *PriorityHelper
func (*PriorityHelper) GetResult ¶
func (h *PriorityHelper) GetResult() (core.HostPriority, error)
func (*PriorityHelper) SetAvoidScore ¶
func (h *PriorityHelper) SetAvoidScore(val int)
func (*PriorityHelper) SetError ¶
func (h *PriorityHelper) SetError(err error)
func (*PriorityHelper) SetPreferScore ¶
func (h *PriorityHelper) SetPreferScore(val int)
func (*PriorityHelper) SetScore ¶
func (h *PriorityHelper) SetScore(val int)
Click to show internal directories.
Click to hide internal directories.