schema

package
v0.0.0-...-ef7a112 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateSchemaRequest

type CreateSchemaRequest struct {
	Name                               string            `json:"name" validate:"required"`
	Description                        string            `json:"description,omitempty"`
	Schema                             schema.JSONSchema `json:"schema" validate:"required"`
	Issuer                             string            `json:"issuer,omitempty"`
	FullyQualifiedVerificationMethodID string            `json:"fullyQualifiedVerificationMethodId,omitempty"`
}

func (CreateSchemaRequest) IsCredentialSchemaRequest

func (csr CreateSchemaRequest) IsCredentialSchemaRequest() bool

IsCredentialSchemaRequest returns true if the request is for a credential schema

func (CreateSchemaRequest) IsValid

func (csr CreateSchemaRequest) IsValid() error

type CreateSchemaResponse

type CreateSchemaResponse struct {
	ID               string                  `json:"id"`
	Type             schema.VCJSONSchemaType `json:"type"`
	Schema           *schema.JSONSchema      `json:"schema,omitempty"`
	CredentialSchema *keyaccess.JWT          `json:"credentialSchema,omitempty"`
}

type DeleteSchemaRequest

type DeleteSchemaRequest struct {
	ID string `json:"id" validate:"required"`
}

type GetSchemaRequest

type GetSchemaRequest struct {
	ID string `json:"id" validate:"required"`
}

type GetSchemaResponse

type GetSchemaResponse struct {
	ID               string                  `json:"id"`
	Type             schema.VCJSONSchemaType `json:"type"`
	Schema           *schema.JSONSchema      `json:"schema,omitempty"`
	CredentialSchema *keyaccess.JWT          `json:"credentialSchema,omitempty"`
}

type ListSchemasRequest

type ListSchemasRequest struct {
	PageRequest *pagination.PageRequest
}

type ListSchemasResponse

type ListSchemasResponse struct {
	Schemas       []GetSchemaResponse `json:"schemas,omitempty"`
	NextPageToken string              `json:"nextPageToken,omitempty"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewSchemaService

func NewSchemaService(s storage.ServiceStorage, keyStore *keystore.Service,
	resolver resolution.Resolver) (*Service, error)

func (Service) CreateSchema

func (s Service) CreateSchema(ctx context.Context, request CreateSchemaRequest) (*CreateSchemaResponse, error)

CreateSchema houses the main service logic for schema creation. It validates the input, and produces a schema value that conforms with the VC JSON Schema specification.

func (Service) DeleteSchema

func (s Service) DeleteSchema(ctx context.Context, request DeleteSchemaRequest) error

func (Service) GetSchema

func (s Service) GetSchema(ctx context.Context, request GetSchemaRequest) (*GetSchemaResponse, error)

func (Service) ListSchemas

func (s Service) ListSchemas(ctx context.Context, request ListSchemasRequest) (*ListSchemasResponse, error)

func (Service) Resolve

Resolve wraps the get schema method for exposing schema access to other services

func (Service) Status

func (s Service) Status() framework.Status

func (Service) Type

func (s Service) Type() framework.Type

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewSchemaStorage

func NewSchemaStorage(db storage.ServiceStorage) (*Storage, error)

func (*Storage) DeleteSchema

func (s *Storage) DeleteSchema(ctx context.Context, id string) error

func (*Storage) GetSchema

func (s *Storage) GetSchema(ctx context.Context, id string) (*StoredSchema, error)

func (*Storage) ListSchemas

func (s *Storage) ListSchemas(ctx context.Context, page common.Page) (*StoredSchemas, error)

ListSchemas attempts to get all stored schemas. It will return those it can even if it has trouble with some.

func (*Storage) StoreSchema

func (s *Storage) StoreSchema(ctx context.Context, schema StoredSchema) error

type StoredSchema

type StoredSchema struct {
	ID               string                  `json:"id"`
	Type             schema.VCJSONSchemaType `json:"type"`
	Schema           *schema.JSONSchema      `json:"schema,omitempty"`
	CredentialSchema *keyaccess.JWT          `json:"credentialSchema,omitempty"`
}

type StoredSchemas

type StoredSchemas struct {
	Schemas       []StoredSchema
	NextPageToken string
}

Jump to

Keyboard shortcuts

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