Documentation ¶
Index ¶
- type Parser
- func (s Parser) GetFieldSlotIndex(field string, schemaBytes []byte) (int, error)
- func (s Parser) ParseClaim(ctx context.Context, credential verifiable.W3CCredential, ...) (*core.Claim, error)
- func (s Parser) ParseSlots(credential verifiable.W3CCredential, schemaBytes []byte) (processor.ParsedSlots, error)
- type Schema
- type SchemaMetadata
- type SerializationSchema
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct { }
Parser can parse claim data according to specification
func (Parser) GetFieldSlotIndex ¶
GetFieldSlotIndex return index of slot from 0 to 7 (each claim has by default 8 slots)
func (Parser) ParseClaim ¶
func (s Parser) ParseClaim(ctx context.Context, credential verifiable.W3CCredential, credentialType string, jsonSchemaBytes []byte, opts *processor.CoreClaimOptions) (*core.Claim, error)
ParseClaim creates Claim object from W3CCredential
func (Parser) ParseSlots ¶
func (s Parser) ParseSlots(credential verifiable.W3CCredential, schemaBytes []byte) (processor.ParsedSlots, error)
ParseSlots converts payload to claim slots using provided schema
type Schema ¶ added in v1.0.0
type Schema struct { Metadata *SchemaMetadata `json:"$metadata"` Schema string `json:"$schema"` Type string `json:"type"` }
type SchemaMetadata ¶ added in v1.0.0
type SchemaMetadata struct { Uris map[string]interface{} `json:"uris"` Serialization *SerializationSchema `json:"serialization"` }
SchemaMetadata is metadata of json schema
Click to show internal directories.
Click to hide internal directories.