listing

package
v0.0.0-...-b7d8635 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByName

type ByName []Risk

ByName implements sort.Interface for []Risk based on the Name field.

func (ByName) Len

func (n ByName) Len() int

func (ByName) Less

func (n ByName) Less(i, j int) bool

func (ByName) Swap

func (n ByName) Swap(i, j int)

type Repository

type Repository interface {
	// GetRiskMatrix returns the risk matrix with the given ID
	GetRiskMatrix(int) (RiskMatrix, error)
	// GetRiskMatrixByPath returns a risk matrix with the specified image path
	GetRiskMatrixByPath(string) (RiskMatrix, error)
	// GetAllRiskMatrix returns all the risk matrix stored
	GetAllRiskMatrix() []RiskMatrix
	// GetAllRisks returns a list of all risks for a given RiskMatrix ID
	GetAllRisks(int) []Risk
	// GetRisk returns a risk with the given ID
	GetRisk(string) (Risk, error)
	// GetMediaPath returns the path where the media is stored
	GetMediaPath() (string, error)
}

type Risk

type Risk struct {
	ID             string
	RiskMatrixID   int
	Name           string
	Probability    int
	Impact         int
	Classification string
	Strategy       string
}

type RiskMatrix

type RiskMatrix struct {
	ID              int
	Path            string
	Project         string
	DateCreated     time.Time
	MatImgWidth     int
	MatImgHeight    int
	MatNrRows       int
	MatNrCols       int
	MatSize         int
	BorderWidth     int
	Multiple        int
	WordHeight      int
	WordWidth       int
	HighRiskColor   color.RGBA
	MediumRiskColor color.RGBA
	LowRiskColor    color.RGBA
	RiskLabelColor  color.RGBA
	BorderColor     color.RGBA
}

type Service

type Service interface {
	GetRiskMatrix(int) (RiskMatrix, error)
	GetRiskMatrixByPath(string) (RiskMatrix, error)
	GetAllRisks(int) []Risk
	GetRisk(string) (Risk, error)
	GetAllRiskMatrix() []RiskMatrix
	GetMediaPath() (string, error)
}

Service provides risk matrix and risk listing operations

func NewService

func NewService(r Repository) Service

NewService creates a listing service with the necessary dependencies

Jump to

Keyboard shortcuts

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