Documentation
¶
Index ¶
- Variables
- type CoreClaimOptions
- type Opt
- type ParsedSlots
- type Parser
- 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) ParseClaim(ctx context.Context, credential verifiable.W3CCredential, ...) (*core.Claim, error)
- func (s *Processor) ParseSlots(credential verifiable.W3CCredential, schema []byte) (ParsedSlots, error)
- func (s *Processor) ValidateData(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 CoreClaimOptions ¶ added in v1.0.0
type CoreClaimOptions struct {
RevNonce uint64 `json:"revNonce"`
Version uint32 `json:"version"`
SubjectPosition string `json:"subjectPosition"`
MerklizedRootPosition string `json:"merklizedRootPosition"`
Updatable bool `json:"updatable"`
}
CoreClaimOptions is params for core claim parsing
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(ctx context.Context, credential verifiable.W3CCredential, credentialType string, jsonSchemaBytes []byte, options *CoreClaimOptions) (*core.Claim, error)
ParseSlots(credential verifiable.W3CCredential, schemaBytes []byte) (ParsedSlots, error)
GetFieldSlotIndex(field string, schema []byte) (int, error)
}
Parser is an interface to parse claim slots
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) ParseClaim ¶ added in v1.0.0
func (s *Processor) ParseClaim(ctx context.Context, credential verifiable.W3CCredential, credentialType string, jsonSchemaBytes []byte, opts *CoreClaimOptions) (*core.Claim, error)
ParseClaim will serialize input data to index and value fields.
func (*Processor) ParseSlots ¶
func (s *Processor) ParseSlots(credential verifiable.W3CCredential, 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.
Click to show internal directories.
Click to hide internal directories.