models

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 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 Answer

type Answer struct {
	Text      string   `json:"text"`
	Datatypes []string `json:"datatypes"`
}

Answer has information about an answer

type Question

type Question struct {
	Text     string            `json:"text"`
	LongText string            `json:"long_text"`
	Answers  map[string]Answer `json:"answers"`
}

Question has information about a question

type Questions

type Questions struct {
	List              map[string]Question `json:"questions"`
	Version           string              `json:"version"`
	RisklevelsVersion string              `json:"risklevels_version"`
	Updated           string              `json:"updated"`
}

Questions is a versioned collection of Question's

func (Questions) Object

func (ql Questions) Object(c, v string) string

Object returns the full S3 path to the object containing questions data for a specific campaign/version

func (Questions) Path

func (ql Questions) Path(c string) string

Path returns the main S3 path containing questions versions for a campaign

type Responses

type Responses struct {
	List              map[string]string `json:"responses"`
	RisklevelsVersion string            `json:"risklevels_version"`
	QuestionsVersion  string            `json:"questions_version"`
	Metadata          interface{}       `json:"metadata"`
}

Responses is a collection of responses to questions submitted by the client

func (Responses) Path

func (r Responses) Path(c string) string

Path returns the main S3 path containing responses for a campaign

type RiskLevel

type RiskLevel struct {
	Text      string   `json:"text"`
	Score     uint     `json:"score"`
	Datatypes []string `json:"datatypes"`
}

RiskLevel describes a security risk level and what data types belong to it

type RiskLevels

type RiskLevels struct {
	List    []RiskLevel `json:"risklevels"`
	Version string      `json:"version"`
	Updated string      `json:"updated"`
}

RiskLevels is a versioned collection of RiskLevel's

func (RiskLevels) Highest

func (rl RiskLevels) Highest(datatypes []string) (RiskLevel, error)

Highest returns the RiskLevel with the highest score based on a list of data types

func (RiskLevels) Object

func (rl RiskLevels) Object(v string) string

Object returns the full S3 path to the object containing risk level data for a specific version

func (RiskLevels) Path

func (rl RiskLevels) Path() string

Path returns the main S3 path containing risk level versions

Jump to

Keyboard shortcuts

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