Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CredTypeToProcedure = map[Type][]ProcedureType{ CredTypeVaccine: { ProcedureTypeCormirnaty, ProcedureTypeJanssen, ProcedureTypeModerna, ProcedureTypeVaxzevria, }, CredTypeNegativeTest: { ProcedureTypeTestAntigen, ProcedureTypePCR, }, }
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct { FirstName string LastName string DateOfBirth time.Time DiseaseType DiseaseType Procedures []Procedure ProcedureOperator string ProcedureResult bool // contains filtered or unexported fields }
Credential represents the bare minimum data the verifier needs to both verify that the offered test is valid, and that the valid test belongs to the person offering it.
func FromCBOR ¶
func FromCBOR(cborCredential []byte) (credential Credential, err error)
FromCBOR decodes a CBOR encoded credential and returns it.
func New ¶
func New( firstName string, lastName string, dob time.Time, procedures []Procedure, operator string, result bool, ) (cred Credential)
New takes all information and returns a credential.
func (Credential) ToCBOR ¶
func (c Credential) ToCBOR() (cborCredential []byte, err error)
ToCBOR marshals the credential to CBOR.
type DiseaseType ¶
type DiseaseType int
const ( // DiseaseTypeUnspecified - Unspecified disease. DiseaseTypeUnspecified DiseaseType = iota // DiseaseTypeCOVID19 - SARS-CoV-19. DiseaseTypeCOVID19 )
type Procedure ¶
type Procedure struct { Type ProcedureType `json:"Type"` Time time.Time `json:"Time"` // contains filtered or unexported fields }
Procedure represents a procedure, which is a combination of procedure type and procedure time.
type ProcedureType ¶
type ProcedureType int
const ( // ProcedureTypeNA - Not Applicable, used for tests and single shot vaccines. ProcedureTypeNA ProcedureType = iota // ProcedureTypeTestAntigen - Antigen tests. ProcedureTypeTestAntigen // ProcedureTypePCR - PCR tests. ProcedureTypePCR // ProcedureTypeCormirnaty - BioNTech Manufacturing GmbH - mRNA vaccine - Dual shots required. ProcedureTypeCormirnaty // ProcedureTypeJanssen - Janssen-Cilag International NV - Vector vaccine - Single shot required. ProcedureTypeJanssen // ProcedureTypeModerna - Moderna Biotech Spain, S.L. - mRNA vaccine - Dual shots required. ProcedureTypeModerna // ProcedureTypeVaxzevria - AstraZeneca AB, Sweden - Vector vaccine - Dual shots required. ProcedureTypeVaxzevria // ProcedureTypeDiagnosis - A positive diagnosis - Any reliable diagnosis of a patient having gotten COVID19. // Treated vaccine-like based on requirements. ProcedureTypeDiagnosis )
Click to show internal directories.
Click to hide internal directories.