Documentation ¶
Overview ¶
Enum to json.UnmarshalJson and json.MarshalJSON taken from: https://gist.github.com/lummie/7f5c237a17853c031a57277371528e87 We might be able to use https://github.com/campoy/jsonenums - might do this after the package is tested.
Enum to json.UnmarshalJson and json.MarshalJSON taken from: https://gist.github.com/lummie/7f5c237a17853c031a57277371528e87 We might be able to use https://github.com/campoy/jsonenums - might do this after the package is tested.
Index ¶
Constants ¶
const ( // Version - version of the `Report`. // TODO(mbana): probably need a better way of getting/setting the version of the Report Exporter Version = "0.0.1" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APISpecification ¶ added in v1.1.6
type CertifiedBy ¶ added in v1.1.0
type CertifiedBy struct { Environment CertifiedByEnvironment `json:"environment"` // Name of the environment tested Brand string `json:"brand"` // Name of the brand tested AuthorisedBy string `json:"authorisedBy"` // Name of the Authoriser JobTitle string `json:"jobTitle"` // Job Title of the Authorisee }
CertifiedBy - contains details of who certified the `Report`.
func (CertifiedBy) Validate ¶ added in v1.1.0
func (r CertifiedBy) Validate() error
Validate - called by `github.com/go-ozzo/ozzo-validation` to validate struct.
type CertifiedByEnvironment ¶ added in v1.1.0
type CertifiedByEnvironment int
CertifiedByEnvironment - the environment the `Report` was generated in.
const ( // ReportCertifiedByEnvironmentTesting - testing environment. CertifiedByEnvironmentTesting CertifiedByEnvironment = iota + 1 // ReportCertifiedByEnvironmentProduction - production environment. CertifiedByEnvironmentProduction CertifiedByEnvironmentSandbox )
func (CertifiedByEnvironment) MarshalJSON ¶ added in v1.1.0
func (r CertifiedByEnvironment) MarshalJSON() ([]byte, error)
MarshalJSON marshals the enum as a quoted json string
func (CertifiedByEnvironment) String ¶ added in v1.1.0
func (r CertifiedByEnvironment) String() string
func (*CertifiedByEnvironment) UnmarshalJSON ¶ added in v1.1.0
func (r *CertifiedByEnvironment) UnmarshalJSON(data []byte) error
UnmarshalJSON unmashals a quoted json string to the enum value
type Exporter ¶
type Exporter interface {
Export() error
}
Exporter - allows the exporting of a `Report`.
func NewZipExporter ¶
NewZipExporter - return new `Exporter` that exports to a ZIP archive to `writer`. The caller should close `writer` after calling `Export`.
For example:
writer, err := os.Create("report.zip") defer writer.Close() exporter := NewZipExporter(Report{}, writer) exporter.Export()
type Importer ¶ added in v1.1.0
Importer - allows the importing of a `Report`.
func NewZipImporter ¶ added in v1.1.0
NewZipImporter - return new `Importer` that allows importing from a ZIP archive.
type Report ¶
type Report struct { ID string `json:"id"` // A unique and immutable identifier used to identify the report. The v4 UUIDs generated conform to RFC 4122. Created string `json:"created"` // Date and time when the report was created, formatted accorrding to RFC3339 (https://tools.ietf.org/html/rfc3339). Note RFC3339 is derived from ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601). Expiration *string `json:"expiration,omitempty"` // Date and time when the report should not longer be accepted, formatted accorrding to RFC3339 (https://tools.ietf.org/html/rfc3339). Note RFC3339 is derived from ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601). Fails int `json:"fails"` // Calculates *total* failures across the whole report, accumulated for each specification. Version string `json:"version"` // The current version of the report model used. Status Status `json:"status"` // A status describing overall condition of the report. CertifiedBy CertifiedBy `json:"certifiedBy"` // The certifier of the report. SignatureChain *[]SignatureChain `json:"signatureChain,omitempty"` // When Add digital signature is set this contains the signature chain. Discovery discovery.Model `json:"-"` // Original used discovery model APISpecification []APISpecification `json:"apiSpecification"` // API and version tested, along with test cases FCSVersion string `json:"fcsVersion"` // Version of FCS running the tests }
Report - The Report.
type SignatureChain ¶ added in v1.1.0
type SignatureChain struct { Type string `json:"type"` Creator string `json:"creator"` Domain string `json:"domain"` Nounce string `json:"nounce"` Value string `json:"value"` }
SignatureChain -
type Status ¶ added in v1.1.0
type Status int
Status - the status of the `Report`.
func (Status) MarshalJSON ¶ added in v1.1.0
MarshalJSON - marshals the enum as a quoted json string
func (*Status) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON - unmashals a quoted json string to the enum value