models

package
v0.0.0-...-10910e6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryTag

type CategoryTag struct {
	ID           int            `json:"id"`
	Value        string         `json:"value"`
	SpecificTags []*SpecificTag `json:"specificTags,omitempty"`
}

CategoryTag model for category tags

type Compliance

type Compliance struct {
	ReportID            int             `json:"reportId"`
	ParagraphID         int             `json:"paragraphId,omitempty"`
	PrimaryCompliance   string          `json:"primaryCompliance"`
	OperationCompliance string          `json:"operationalCompliance"`
	SecondaryCompliance string          `json:"secondaryCompliance"`
	Pages               json.RawMessage `json:"pages"`
}

Compliance model for compliances

type DB

type DB struct {
	*sql.DB
}

func NewDB

func NewDB(databaseURI string) (*DB, error)

NewDB database initializer

func (*DB) AllCategoryTags

func (db *DB) AllCategoryTags(lang interface{}) ([]*CategoryTag, error)

AllCategoryTags returns a slice with all Category Tags

func (*DB) AllCompliances

func (db *DB) AllCompliances(lang interface{}) ([]*Compliance, error)

AllCompliances returns a slice with all paragraphs

func (*DB) AllParagraphs

func (db *DB) AllParagraphs(lang interface{}) ([]*Paragraph, error)

AllParagraphs returns a slice with all paragraphs

func (*DB) AllReports

func (db *DB) AllReports(lang interface{}) ([]*Report, error)

AllReports returns a slice with all reports

func (*DB) AllSOPs

func (db *DB) AllSOPs(lang interface{}) ([]*SOP, error)

AllSOPS returns a slice of all SOPS

func (*DB) AllSpecificTags

func (db *DB) AllSpecificTags(lang interface{}) ([]*SpecificTag, error)

AllSpecificTags returns a slice with all Specific Tags

func (*DB) GetCategoryTag

func (db *DB) GetCategoryTag(lang interface{}, categoryTag CategoryTag) (*CategoryTag, error)

GetCategoryTag returns a Category Tag given a CategoryTag.ID

func (*DB) GetCategoryTagsByParagraph

func (db *DB) GetCategoryTagsByParagraph(lang interface{}, paragraph Paragraph) ([]*CategoryTag, error)

GetCategoryTagsByParagraph returns a slice with category tags given a Paragraph.ID

func (*DB) GetCompliancesByParagraph

func (db *DB) GetCompliancesByParagraph(lang interface{}, paragraph Paragraph) ([]*Compliance, error)

GetCompliancesByParagraph Returns a slice of Compliances given a Paragraph.ParagraphNumber

func (*DB) GetCompliancesByReport

func (db *DB) GetCompliancesByReport(lang interface{}, report Report) ([]*Compliance, error)

GetCompliancesByReport Returns a slice of Compliances given a Report.ID

func (*DB) GetParagraph

func (db *DB) GetParagraph(lang interface{}, paragraph Paragraph) (*Paragraph, error)

GetParagraph Returns a single paragraph given a Paragraph.ID

func (*DB) GetParagraphsByCategoryTag

func (db *DB) GetParagraphsByCategoryTag(lang interface{}, categoryTag CategoryTag) ([]*Paragraph, error)

GetParagraphsByCategoryTag returns a slice with all paragraphs given a CategoryTag.ID

func (*DB) GetParagraphsBySpecificTag

func (db *DB) GetParagraphsBySpecificTag(lang interface{}, specificTag SpecificTag) ([]*Paragraph, error)

GetParagraphsBySpecificTag returns a slice with all paragraphs given a SpecificTag.ID

func (*DB) GetReport

func (db *DB) GetReport(lang interface{}, report Report) (*Report, error)

GetReport Returns a single report given a Report.ID (report_number in DB)

func (*DB) GetSOP

func (db *DB) GetSOP(lang interface{}, sop SOP) (*SOP, error)

GetSOP returns a single SOP given a SOP.ID

func (*DB) GetSOPsByCategoryTag

func (db *DB) GetSOPsByCategoryTag(lang interface{}, categoryTag CategoryTag) ([]*SOP, error)

GetSOPsByCategoryTag returns SOPs given a categoryTag.ID

func (*DB) GetSOPsByParagraph

func (db *DB) GetSOPsByParagraph(lang interface{}, paragraph Paragraph) ([]*SOP, error)

GetSOPSByParagraph returns SOPs given a paragraph.ID

func (*DB) GetSOPsBySpecificTag

func (db *DB) GetSOPsBySpecificTag(lang interface{}, specificTag SpecificTag) ([]*SOP, error)

GetSOPsBySpecficTag returns SOPs given a specificTag.ID

func (*DB) GetSpecificTag

func (db *DB) GetSpecificTag(lang interface{}, specificTag SpecificTag) (*SpecificTag, error)

GetSpecificTag returns a Category Tag given a SpecificTag.ID

func (*DB) GetSpecificTagsByParagraph

func (db *DB) GetSpecificTagsByParagraph(lang interface{}, paragraph Paragraph) ([]*SpecificTag, error)

GetSpecificTagsByParagraph returns a slice with specific tags given a Paragraph.ID

type Datastore

type Datastore interface {
	AllParagraphs(lang interface{}) ([]*Paragraph, error)
	GetParagraph(lang interface{}, paragraph Paragraph) (*Paragraph, error)
	GetParagraphsBySpecificTag(lang interface{}, specificTag SpecificTag) ([]*Paragraph, error)
	GetParagraphsByCategoryTag(lang interface{}, categoryTag CategoryTag) ([]*Paragraph, error)
	AllCompliances(lang interface{}) ([]*Compliance, error)
	//GetCompliance(lang interface{}, compliance Compliance) (*Compliance, error)
	GetCompliancesByParagraph(lang interface{}, paragraph Paragraph) ([]*Compliance, error)
	GetCompliancesByReport(lang interface{}, report Report) ([]*Compliance, error)
	AllReports(lang interface{}) ([]*Report, error)
	GetReport(lang interface{}, report Report) (*Report, error)
	AllCategoryTags(lang interface{}) ([]*CategoryTag, error)
	GetCategoryTag(lang interface{}, categoryTag CategoryTag) (*CategoryTag, error)
	GetCategoryTagsByParagraph(lang interface{}, paragraph Paragraph) ([]*CategoryTag, error)
	AllSpecificTags(lang interface{}) ([]*SpecificTag, error)
	GetSpecificTag(lang interface{}, specificTag SpecificTag) (*SpecificTag, error)
	GetSpecificTagsByParagraph(lang interface{}, paragraph Paragraph) ([]*SpecificTag, error)
}

type Paragraph

type Paragraph struct {
	UUID            string `json:"-"`
	ID              int    `json:"id"`
	ParagraphNumber int    `json:"paragraphNumber"`
	ParagraphTitle  string `json:"paragraphTitle"`
	ParagraphText   string `json:"paragraphText"`
}

Paragraph model for CASA paragraphs

type Report

type Report struct {
	UUID        string `json:"-"`
	ID          int    `json:"id"`
	ReportName  string `json:"reportName"`
	ReportTitle string `json:"reportTitle"`
	PublishDate string `json:"publishDate"`
	PeriodBegin string `json:"periodBegin"`
	PeriodEnd   string `json:"periodEnd"`
}

Report model for Independent monitoring reports

type SOP

type SOP struct {
	UUID          string `json:"-"`
	ID            string `json:"id"`
	Name          string `json:"name"`
	Title         string `json:"title"`
	Current       bool   `json:"current"`
	EffectiveDate string `json:"effective_date"`
	ReviewDate    string `json:"review_date"`
	ReplacesDate  string `json:"replaces_date"`
}

SOP model for Independent monitoring reports

type SpecificTag

type SpecificTag struct {
	ID         int    `json:"id"`
	Value      string `json:"value"`
	CategoryID int    `json:"categoryId,omitempty"`
}

SpecificTag model for specific tags

Jump to

Keyboard shortcuts

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