Documentation
¶
Index ¶
- type ClaimBasicContext
- type ClaimContext
- type ClaimSchema
- type Parser
- func (p Parser) AssignSlots(content []byte, ctx *ClaimContext) (processor.ParsedSlots, error)
- func (p Parser) FillSlots(data []byte, ctx *ClaimContext) (processor.ParsedSlots, error)
- func (p Parser) GetFieldSlotIndex(field string, schema []byte) (int, error)
- func (p Parser) ParseClaim(credential *verifiable.Iden3Credential, schemaBytes []byte) (*core.Claim, error)
- func (p Parser) ParseSlots(data, schema []byte) (processor.ParsedSlots, error)
- type SchemaContext
- type SerializationField
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaimBasicContext ¶
type ClaimBasicContext struct { Version float64 `json:"@version"` Protected bool `json:"@protected"` ID string `json:"id"` Type string `json:"type"` }
ClaimBasicContext is representation of default fields for claim schema
type ClaimContext ¶
type ClaimContext struct { ClaimBasicContext Fields map[string]SerializationField Vocab map[string]string }
ClaimContext all parsed fields of ClaimSchema
type ClaimSchema ¶
ClaimSchema is description of schema for specific claim type
type Parser ¶
type Parser struct { ClaimType string ParsingStrategy processor.ParsingStrategy }
Parser can parse claim data according to specification
func (Parser) AssignSlots ¶
func (p Parser) AssignSlots(content []byte, ctx *ClaimContext) (processor.ParsedSlots, error)
AssignSlots adds content to claim slots according its specification slot
func (Parser) FillSlots ¶
func (p Parser) FillSlots(data []byte, ctx *ClaimContext) (processor.ParsedSlots, error)
FillSlots fills slots sequentially
func (Parser) GetFieldSlotIndex ¶
GetFieldSlotIndex return index of slot from 0 to 7 (each claim has by default 8 slots)
func (Parser) ParseClaim ¶
func (p Parser) ParseClaim(credential *verifiable.Iden3Credential, schemaBytes []byte) (*core.Claim, error)
ParseClaim creates Claim object from Iden3Credential
func (Parser) ParseSlots ¶
func (p Parser) ParseSlots(data, schema []byte) (processor.ParsedSlots, error)
ParseSlots converts payload to claim slots using provided schema
type SchemaContext ¶
type SchemaContext struct {
Context []map[string]interface{} `json:"@context"`
}
SchemaContext is top-level wrapper of json-ld schema
type SerializationField ¶
SerializationField represents fields that rather must be parsed to value or index