prioritization

package
v0.0.179 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 0 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrioritizedResource

type PrioritizedResource struct {
	ResourceID     string           `json:"resourceID"`
	PriorityVector []PriorityVector `json:"priorityVector"`
}

PrioritizedResource - resource with a score based on its priority vectors

func (*PrioritizedResource) GetResourceID

func (pr *PrioritizedResource) GetResourceID() string

GetResourceID get the resource ID

func (*PrioritizedResource) GetScore

func (pr *PrioritizedResource) GetScore() float64

GetScore get resource score, which is a sum of its priority vectors scores

func (*PrioritizedResource) ListControlsIDs

func (pr *PrioritizedResource) ListControlsIDs() []string

ListControlsIDs return a list of controls IDs from all priority vectors of a given resource

func (*PrioritizedResource) SetResourceID

func (pr *PrioritizedResource) SetResourceID(resourceID string)

SetResourceID set the resource ID

type PriorityVector

type PriorityVector struct {
	Type   PriorityVectorType `json:"type"`
	Vector []string           `json:"vector"`
	Score  float64            `json:"score"`
}

PriorityVector a list of items of a specific type and a score

func NewControlPriorityVector

func NewControlPriorityVector() *PriorityVector

func (*PriorityVector) Add

func (pv *PriorityVector) Add(item string)

Add adds an item to the priority vector

func (*PriorityVector) GetScore

func (pv *PriorityVector) GetScore() float64

GetScore get priority vector score

func (*PriorityVector) GetType

func (pv *PriorityVector) GetType() PriorityVectorType

GetType returns the priority vector type

func (*PriorityVector) List

func (pv *PriorityVector) List() []string

List returns the list of items in the priority vector

func (*PriorityVector) SetScore

func (pr *PriorityVector) SetScore(score float64)

SetScore set priority vector score

type PriorityVectorType

type PriorityVectorType string
const (
	ControlPriorityVectorType PriorityVectorType = "control"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL