Documentation ¶
Index ¶
- Variables
- type Opt
- type ParsedSlots
- type Parser
- type ParsingStrategy
- type Processor
- func (s *Processor) GetFieldSlotIndex(field string, schema []byte) (int, error)
- func (s *Processor) Load(ctx context.Context) (schema []byte, extension string, err error)
- func (s *Processor) ParseSlots(data, schema []byte) (ParsedSlots, error)
- func (s *Processor) ValidateData(data, schema []byte) error
- func (s *Processor) ValidateDocument(data, schema []byte) error
- type SchemaLoader
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSlotsOverflow thrown on claim slot overflow ErrSlotsOverflow = errors.New("slots overflow") )
Functions ¶
This section is empty.
Types ¶
type Opt ¶
type Opt func(opts *Processor)
Opt returns configuration options for processor suite
func WithSchemaLoader ¶
func WithSchemaLoader(s SchemaLoader) Opt
WithSchemaLoader return new options
type ParsedSlots ¶
ParsedSlots is struct that represents iden3 claim specification
type Parser ¶
type Parser interface { ParseClaim(credentialBytes *verifiable.Iden3Credential, schemaBytes []byte) (*core.Claim, error) ParseSlots(data, schema []byte) (ParsedSlots, error) GetFieldSlotIndex(field string, schema []byte) (int, error) }
Parser is an interface to parse claim slots
type ParsingStrategy ¶
type ParsingStrategy int
ParsingStrategy is used for parser to know how to fill claim slots
const ( // OneFieldPerSlotStrategy is strategy when one field corresponds exactly to the one slot OneFieldPerSlotStrategy ParsingStrategy = iota + 1 // SlotFullfilmentStrategy is strategy when field putting in the claim slot sequentially SlotFullfilmentStrategy )
type Processor ¶
type Processor struct { Validator Validator SchemaLoader SchemaLoader Parser Parser }
Processor is set of tool for claim processing
func InitProcessorOptions ¶
InitProcessorOptions initializes processor with options.
func (*Processor) GetFieldSlotIndex ¶
GetFieldSlotIndex returns index of slot for specified field according to schema
func (*Processor) ParseSlots ¶
func (s *Processor) ParseSlots(data, schema []byte) (ParsedSlots, error)
ParseSlots will serialize input data to index and value fields.
func (*Processor) ValidateData ¶
ValidateData will validate a claim content by given schema.
func (*Processor) ValidateDocument ¶
ValidateDocument will validate a document content by given schema.
Click to show internal directories.
Click to hide internal directories.