Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct {
// Titles is a required field.
// It is required to have the same length of titles as there are languages in the presentation.
Titles map[Language]string
// Optional defines if the Element is an optional field - which means it could have empty values.
Optional bool
// Format is not a required field.
// There is no default value.
Format ElementFormat
// Multilanguage is not a required field.
// Default value is false.
Multilanguage bool
// Value is a required field if Multilanguage is set to false.
// It requires a pointer to a field in payload.
//
// Example value would be "/issuanceDate"
Value string
// Values is a required field if Multilanguage is set to true.
// It requires a pointer to a field in payload.
//
// Example value for en would be "/issuer/legalName/en"
Values map[Language]string
}
func (*Element) NewElement ¶
func (*Element) TitleContainsAllLanguages ¶
type ElementFormat ¶
type ElementFormat struct {
Type FormatType `json:"-"` // Don't serialize this field
}
ElementFormat represents the format configuration for an element
func NewDateFormat ¶ added in v0.1.29
func NewDateFormat() ElementFormat
NewDateFormat creates a new Date format
func NewDateTimeFormat ¶
func NewDateTimeFormat() ElementFormat
NewDateTimeFormat creates a new DateTime format
func NewDurationFormat ¶
func NewDurationFormat() ElementFormat
NewDurationFormat creates a new Duration format
func NewJpegFormat ¶ added in v0.1.23
func NewJpegFormat() ElementFormat
NewJpegFormat creates a new format for displaying base64 jpeg image
func NewPngFormat ¶ added in v0.1.23
func NewPngFormat() ElementFormat
NewPngFormat creates a new format for displaying base64 png image
func (*ElementFormat) IsEmpty ¶
func (f *ElementFormat) IsEmpty() bool
IsEmpty returns true if the format is not set
func (*ElementFormat) MarshalJSON ¶
func (f *ElementFormat) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface This ensures that ElementFormat serializes as a simple string value
func (*ElementFormat) String ¶
func (f *ElementFormat) String() string
String returns the string representation of the format
func (*ElementFormat) UnmarshalJSON ¶
func (f *ElementFormat) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler interface
type FormatType ¶
type FormatType string
FormatType represents the type of format for an element
const ( FormatDate FormatType = "date" FormatDateTime FormatType = "date-time" FormatDuration FormatType = "duration" FormatJPEG FormatType = "jpeg" FormatPNG FormatType = "png" )
type Language ¶
type Language struct {
Code string
}
func NewLanguage ¶
NewLanguage creates a new Language with validation
type Presentation ¶
type Presentation struct {
Languages []Language
Groups []Group
Title map[Language]string
Description map[Language]string
ExpirationDate string
Issuer string
IssuerLogo string
IssuerLogoContentType string
}
func (*Presentation) Create ¶
func (p *Presentation) Create() ([]byte, error)
func (*Presentation) ValidateElement ¶
func (p *Presentation) ValidateElement(element *Element) error