Documentation ¶
Index ¶
- Constants
- func GetMIMEType(imageType string) string
- func UnmarshallJSON(byteValue []byte) (result interface{}, err error)
- type AttributeDefinition
- type DocumentDetails
- type DocumentDetailsAttribute
- type GenericAttribute
- type Image
- type ImageAttribute
- type ImageSliceAttribute
- type IssuanceDetails
- type Item
- type JSONAttribute
- type MultiValueAttribute
- type StringAttribute
- type TimeAttribute
Examples ¶
Constants ¶
const ( // ImageTypeJpeg JPEG format ImageTypeJpeg string = "jpeg" // ImageTypePng PNG format ImageTypePng string = "png" )
Variables ¶
This section is empty.
Functions ¶
func GetMIMEType ¶
GetMIMEType returns the MIME type of this piece of Yoti user information. For more information see: https://en.wikipedia.org/wiki/Media_type
func UnmarshallJSON ¶
UnmarshallJSON unmarshalls JSON into an interface
Types ¶
type AttributeDefinition ¶ added in v2.7.0
type AttributeDefinition struct {
// contains filtered or unexported fields
}
AttributeDefinition contains information about the attribute(s) issued by a third party.
func NewAttributeDefinition ¶ added in v2.7.0
func NewAttributeDefinition(s string) AttributeDefinition
NewAttributeDefinition returns a new AttributeDefinition
func (AttributeDefinition) MarshalJSON ¶ added in v2.7.0
func (a AttributeDefinition) MarshalJSON() ([]byte, error)
MarshalJSON returns encoded json
func (AttributeDefinition) Name ¶ added in v2.7.0
func (a AttributeDefinition) Name() string
Name of the attribute to be issued.
type DocumentDetails ¶ added in v2.6.0
type DocumentDetails struct { DocumentType string IssuingCountry string DocumentNumber string ExpirationDate *time.Time IssuingAuthority string }
DocumentDetails represents information extracted from a document provided by the user
func (*DocumentDetails) Parse ¶ added in v2.6.0
func (details *DocumentDetails) Parse(data string) (err error)
Parse fills a DocumentDetails object from a raw string
Example ¶
raw := "PASSPORT GBR 1234567 2022-09-12" details := DocumentDetails{} err := details.Parse(raw) if err != nil { panic(err) } fmt.Printf( "Document Type: %s, Issuing Country: %s, Document Number: %s, Expiration Date: %s", details.DocumentType, details.IssuingCountry, details.DocumentNumber, details.ExpirationDate, )
Output: Document Type: PASSPORT, Issuing Country: GBR, Document Number: 1234567, Expiration Date: 2022-09-12 00:00:00 +0000 UTC
type DocumentDetailsAttribute ¶ added in v2.6.0
type DocumentDetailsAttribute struct { *yotiprotoattr.Attribute // contains filtered or unexported fields }
DocumentDetailsAttribute wraps a document details with anchor data
func NewDocumentDetails ¶ added in v2.6.0
func NewDocumentDetails(a *yotiprotoattr.Attribute) (*DocumentDetailsAttribute, error)
NewDocumentDetails creates a DocumentDetailsAttribute which wraps a DocumentDetails with anchor data
func (*DocumentDetailsAttribute) Anchors ¶ added in v2.6.0
func (attr *DocumentDetailsAttribute) Anchors() []*anchor.Anchor
Anchors are the metadata associated with an attribute. They describe how an attribute has been provided to Yoti (SOURCE Anchor) and how it has been verified (VERIFIER Anchor).
func (*DocumentDetailsAttribute) Sources ¶ added in v2.6.0
func (attr *DocumentDetailsAttribute) Sources() []*anchor.Anchor
Sources returns the anchors which identify how and when an attribute value was acquired.
func (*DocumentDetailsAttribute) Value ¶ added in v2.6.0
func (attr *DocumentDetailsAttribute) Value() DocumentDetails
Value returns the document details struct attached to this attribute
func (*DocumentDetailsAttribute) Verifiers ¶ added in v2.6.0
func (attr *DocumentDetailsAttribute) Verifiers() []*anchor.Anchor
Verifiers returns the anchors which identify how and when an attribute value was verified by another provider.
type GenericAttribute ¶
type GenericAttribute struct { *yotiprotoattr.Attribute // contains filtered or unexported fields }
GenericAttribute is a Yoti attribute which returns a generic value
func NewGeneric ¶
func NewGeneric(a *yotiprotoattr.Attribute) *GenericAttribute
NewGeneric creates a new generic attribute
func (*GenericAttribute) Anchors ¶
func (a *GenericAttribute) Anchors() []*anchor.Anchor
Anchors are the metadata associated with an attribute. They describe how an attribute has been provided to Yoti (SOURCE Anchor) and how it has been verified (VERIFIER Anchor).
func (*GenericAttribute) Sources ¶
func (a *GenericAttribute) Sources() []*anchor.Anchor
Sources returns the anchors which identify how and when an attribute value was acquired.
func (*GenericAttribute) Value ¶
func (a *GenericAttribute) Value() interface{}
Value returns the value of the GenericAttribute as an interface
func (*GenericAttribute) Verifiers ¶
func (a *GenericAttribute) Verifiers() []*anchor.Anchor
Verifiers returns the anchors which identify how and when an attribute value was verified by another provider.
type Image ¶
Image format of the image and the image data
func CreateImageSlice ¶
CreateImageSlice takes a slice of Items, and converts them into a slice of images
func ParseImageValue ¶
func ParseImageValue(contentType yotiprotoattr.ContentType, byteValue []byte) (*Image, error)
ParseImageValue wraps image data into an image struct
type ImageAttribute ¶
type ImageAttribute struct { *yotiprotoattr.Attribute // contains filtered or unexported fields }
ImageAttribute is a Yoti attribute which returns an image as its value
func NewImage ¶
func NewImage(a *yotiprotoattr.Attribute) (*ImageAttribute, error)
NewImage creates a new Image attribute
func (*ImageAttribute) Anchors ¶
func (a *ImageAttribute) Anchors() []*anchor.Anchor
Anchors are the metadata associated with an attribute. They describe how an attribute has been provided to Yoti (SOURCE Anchor) and how it has been verified (VERIFIER Anchor).
func (*ImageAttribute) Sources ¶
func (a *ImageAttribute) Sources() []*anchor.Anchor
Sources returns the anchors which identify how and when an attribute value was acquired.
func (*ImageAttribute) Value ¶
func (a *ImageAttribute) Value() *Image
Value returns the value of the ImageAttribute as *Image
func (*ImageAttribute) Verifiers ¶
func (a *ImageAttribute) Verifiers() []*anchor.Anchor
Verifiers returns the anchors which identify how and when an attribute value was verified by another provider.
type ImageSliceAttribute ¶
type ImageSliceAttribute struct { *yotiprotoattr.Attribute // contains filtered or unexported fields }
ImageSliceAttribute is a Yoti attribute which returns a slice of images as its value
func NewImageSlice ¶
func NewImageSlice(a *yotiprotoattr.Attribute) (*ImageSliceAttribute, error)
NewImageSlice creates a new ImageSlice attribute
func (*ImageSliceAttribute) Anchors ¶
func (a *ImageSliceAttribute) Anchors() []*anchor.Anchor
Anchors are the metadata associated with an attribute. They describe how an attribute has been provided to Yoti (SOURCE Anchor) and how it has been verified (VERIFIER Anchor).
func (*ImageSliceAttribute) Sources ¶
func (a *ImageSliceAttribute) Sources() []*anchor.Anchor
Sources returns the anchors which identify how and when an attribute value was acquired.
func (*ImageSliceAttribute) Value ¶
func (a *ImageSliceAttribute) Value() []*Image
Value returns the value of the ImageSliceAttribute as a string
func (*ImageSliceAttribute) Verifiers ¶
func (a *ImageSliceAttribute) Verifiers() []*anchor.Anchor
Verifiers returns the anchors which identify how and when an attribute value was verified by another provider.
type IssuanceDetails ¶ added in v2.7.0
type IssuanceDetails struct {
// contains filtered or unexported fields
}
IssuanceDetails contains information about the attribute(s) issued by a third party
func ParseIssuanceDetails ¶ added in v2.7.0
func ParseIssuanceDetails(thirdPartyAttributeBytes []byte) (*IssuanceDetails, error)
ParseIssuanceDetails takes the Third Party Attribute object and converts it into an IssuanceDetails struct
func (IssuanceDetails) Attributes ¶ added in v2.7.0
func (i IssuanceDetails) Attributes() []AttributeDefinition
Attributes information about the attributes the third party would like to issue.
func (IssuanceDetails) ExpiryDate ¶ added in v2.7.0
func (i IssuanceDetails) ExpiryDate() *time.Time
ExpiryDate is the timestamp at which the request for the attribute value from third party will expire. Will be nil if not provided.
func (IssuanceDetails) Token ¶ added in v2.7.0
func (i IssuanceDetails) Token() string
Token is the issuance token that can be used to retrieve the user's stored details. These details will be used to issue attributes on behalf of an organisation to that user.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item is a structure which contains information about an attribute value
func (*Item) GetContentType ¶
func (item *Item) GetContentType() yotiprotoattr.ContentType
GetContentType returns the content type of the item.
type JSONAttribute ¶
type JSONAttribute struct { *yotiprotoattr.Attribute // Value returns the value of a JSON attribute in the form of an interface // contains filtered or unexported fields }
JSONAttribute is a Yoti attribute which returns an interface as its value
func NewJSON ¶
func NewJSON(a *yotiprotoattr.Attribute) (*JSONAttribute, error)
NewJSON creates a new JSON attribute
func (*JSONAttribute) Anchors ¶
func (a *JSONAttribute) Anchors() []*anchor.Anchor
Anchors are the metadata associated with an attribute. They describe how an attribute has been provided to Yoti (SOURCE Anchor) and how it has been verified (VERIFIER Anchor).
func (*JSONAttribute) Sources ¶
func (a *JSONAttribute) Sources() []*anchor.Anchor
Sources returns the anchors which identify how and when an attribute value was acquired.
func (*JSONAttribute) Value ¶
func (a *JSONAttribute) Value() interface{}
Value returns the value of the JSONAttribute as an interface.
func (*JSONAttribute) Verifiers ¶
func (a *JSONAttribute) Verifiers() []*anchor.Anchor
Verifiers returns the anchors which identify how and when an attribute value was verified by another provider.
type MultiValueAttribute ¶
type MultiValueAttribute struct { *yotiprotoattr.Attribute // contains filtered or unexported fields }
MultiValueAttribute is a Yoti attribute which returns a multi-valued attribute
func NewMultiValue ¶
func NewMultiValue(a *yotiprotoattr.Attribute) (*MultiValueAttribute, error)
NewMultiValue creates a new MultiValue attribute
func (*MultiValueAttribute) Anchors ¶
func (a *MultiValueAttribute) Anchors() []*anchor.Anchor
Anchors are the metadata associated with an attribute. They describe how an attribute has been provided to Yoti (SOURCE Anchor) and how it has been verified (VERIFIER Anchor).
func (*MultiValueAttribute) Sources ¶
func (a *MultiValueAttribute) Sources() []*anchor.Anchor
Sources returns the anchors which identify how and when an attribute value was acquired.
func (*MultiValueAttribute) Value ¶
func (a *MultiValueAttribute) Value() []*Item
Value returns the value of the MultiValueAttribute as a string
func (*MultiValueAttribute) Verifiers ¶
func (a *MultiValueAttribute) Verifiers() []*anchor.Anchor
Verifiers returns the anchors which identify how and when an attribute value was verified by another provider.
type StringAttribute ¶
type StringAttribute struct { *yotiprotoattr.Attribute // contains filtered or unexported fields }
StringAttribute is a Yoti attribute which returns a string as its value
func NewString ¶
func NewString(a *yotiprotoattr.Attribute) *StringAttribute
NewString creates a new String attribute
func (*StringAttribute) Anchors ¶
func (a *StringAttribute) Anchors() []*anchor.Anchor
Anchors are the metadata associated with an attribute. They describe how an attribute has been provided to Yoti (SOURCE Anchor) and how it has been verified (VERIFIER Anchor).
func (*StringAttribute) Sources ¶
func (a *StringAttribute) Sources() []*anchor.Anchor
Sources returns the anchors which identify how and when an attribute value was acquired.
func (*StringAttribute) Value ¶
func (a *StringAttribute) Value() string
Value returns the value of the StringAttribute as a string
func (*StringAttribute) Verifiers ¶
func (a *StringAttribute) Verifiers() []*anchor.Anchor
Verifiers returns the anchors which identify how and when an attribute value was verified by another provider.
type TimeAttribute ¶
type TimeAttribute struct { *yotiprotoattr.Attribute // contains filtered or unexported fields }
TimeAttribute is a Yoti attribute which returns a time as its value
func NewTime ¶
func NewTime(a *yotiprotoattr.Attribute) (*TimeAttribute, error)
NewTime creates a new Time attribute
func (*TimeAttribute) Anchors ¶
func (a *TimeAttribute) Anchors() []*anchor.Anchor
Anchors are the metadata associated with an attribute. They describe how an attribute has been provided to Yoti (SOURCE Anchor) and how it has been verified (VERIFIER Anchor).
func (*TimeAttribute) Sources ¶
func (a *TimeAttribute) Sources() []*anchor.Anchor
Sources returns the anchors which identify how and when an attribute value was acquired.
func (*TimeAttribute) Value ¶
func (a *TimeAttribute) Value() *time.Time
Value returns the value of the TimeAttribute as *time.Time
func (*TimeAttribute) Verifiers ¶
func (a *TimeAttribute) Verifiers() []*anchor.Anchor
Verifiers returns the anchors which identify how and when an attribute value was verified by another provider.