Documentation ¶
Index ¶
- Constants
- type Risk
- type RiskMatrix
- type Storage
- func (s *Storage) AddRisk(r adding.Risk) error
- func (s *Storage) AddRiskMatrix(rm adding.RiskMatrix) error
- func (s *Storage) DeleteRisk(riskID string) error
- func (s *Storage) DeleteRiskMatrix(riskMatrixID int) error
- func (s *Storage) GetAllRiskMatrix() []listing.RiskMatrix
- func (s *Storage) GetAllRisks(riskMatrixID int) []listing.Risk
- func (s *Storage) GetMediaPath() (string, error)
- func (s *Storage) GetRisk(riskID string) (listing.Risk, error)
- func (s *Storage) GetRiskMatrix(id int) (listing.RiskMatrix, error)
- func (s *Storage) GetRiskMatrixByPath(p string) (listing.RiskMatrix, error)
- func (s *Storage) SaveMediaPath(path string) error
- func (s *Storage) UpdateRiskMatrixSize(riskMatrixID, newSize int) error
Constants ¶
const ( // CollectionRisk identifier for the JSON collection of risks CollectionRisk = "risks" // CollectionMatrix identifier for the JSON collection of matrix CollectionMatrix = "matrix" // MediaPath identifier for the path of media files MediaPath = "media" // MediaResource is the resource ID to access the MediaPath in the storage MediaResource = "1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RiskMatrix ¶
type RiskMatrix struct { ID int `json:"id"` Path string `json:"path"` Project string `json:"project"` DateCreated time.Time `json:"date_created"` MatImgWidth int `json:"mat_img_width"` MatImgHeight int `json:"mat_img_height"` MatNrRows int `json:"mat_nr_rows"` MatNrCols int `json:"mat_nr_cols"` MatSize int `json:"mat_size"` BorderWidth int `json:"border_width"` Multiple int `json:"multiple"` WordHeight int `json:"word_height"` WordWidth int `json:"word_width"` HighRiskColor color.RGBA `json:"high_risk_color"` MediumRiskColor color.RGBA `json:"medium_risk_color"` LowRiskColor color.RGBA `json:"low_risk_color"` RiskLabelColor color.RGBA `json:"risk_label_color"` BorderColor color.RGBA `json:"border_color"` }
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Json storage keeps data in json files
func (*Storage) AddRiskMatrix ¶
func (s *Storage) AddRiskMatrix(rm adding.RiskMatrix) error
AddRiskMatrix saves the given risk matrix in repository
func (*Storage) DeleteRisk ¶
DeleteRisk deletes a risk with the specified ID
func (*Storage) DeleteRiskMatrix ¶
DeleteMatrix deletes a risk matrix with the specified ID
func (*Storage) GetAllRiskMatrix ¶
func (s *Storage) GetAllRiskMatrix() []listing.RiskMatrix
GetAllRiskMatrix returns all the risk matrix stored in the database
func (*Storage) GetAllRisks ¶
GetAllRisks returns all the risks for a given risk matrix
func (*Storage) GetMediaPath ¶
GetMediaPath get the media path stored.
func (*Storage) GetRiskMatrix ¶
func (s *Storage) GetRiskMatrix(id int) (listing.RiskMatrix, error)
GetRiskMatrix returns a risk matrix with the specified ID
func (*Storage) GetRiskMatrixByPath ¶
func (s *Storage) GetRiskMatrixByPath(p string) (listing.RiskMatrix, error)
GetRiskMatrixByPath returns a risk matrix with the specified image path
func (*Storage) SaveMediaPath ¶
SaveMediaPath saves the given path that is going to be used to store media files, i.e., the risk matrix pictures.
func (*Storage) UpdateRiskMatrixSize ¶
UpdateRiskMatrixSize updates the risk matrix size of a given risk matrix in the repository