schema

package
v0.0.2-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// VCJSONSchemaType https://w3c-ccg.github.io/vc-json-schemas/v2/index.html#credential_schema_definition_metadata
	VCJSONSchemaType string = "https://w3c-ccg.github.io/vc-json-schemas/schema/2.0/schema.json"
)

Variables

This section is empty.

Functions

func IsCredentialValidForSchema

func IsCredentialValidForSchema(cred credential.VerifiableCredential, s string) error

IsCredentialValidForSchema determines whether a given Verifiable Credential is valid against a specified credential schema

func IsCredentialValidForVCJSONSchema

func IsCredentialValidForVCJSONSchema(credential credential.VerifiableCredential, vcJSONSchema VCJSONSchema) error

func IsValidCredentialSchema

func IsValidCredentialSchema(maybeCredentialSchema string) error

IsValidCredentialSchema determines if a given credential schema is compliant with the specification's JSON Schema https://w3c-ccg.github.io/vc-json-schemas/v2/index.html#credential_schema_definition

Types

type JSONSchema

type JSONSchema map[string]interface{}

type VCJSONSchema

type VCJSONSchema struct {
	Type     string     `json:"type"`
	Version  string     `json:"version"`
	ID       string     `json:"id"`
	Name     string     `json:"name"`
	Author   string     `json:"author"`
	Authored string     `json:"authored"`
	Schema   JSONSchema `json:"schema"`
}

VCJSONSchema is the model representing the credential json schema specification https://w3c-ccg.github.io/vc-json-schemas/v2/index.html#credential_schema_definition

func StringToVCJSONCredentialSchema

func StringToVCJSONCredentialSchema(maybeVCJSONCredentialSchema string) (*VCJSONSchema, error)

StringToVCJSONCredentialSchema marshals a string into a credential json credential schema

func (VCJSONSchema) GetProperty

func (vcs VCJSONSchema) GetProperty(propertyName string) (interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL