Documentation ¶
Index ¶
- type CreateSchemaRequest
- type CreateSchemaResponse
- type DeleteSchemaRequest
- type GetSchemaRequest
- type GetSchemaResponse
- type ListSchemasRequest
- type ListSchemasResponse
- type Service
- func (s Service) CreateSchema(ctx context.Context, request CreateSchemaRequest) (*CreateSchemaResponse, error)
- func (s Service) DeleteSchema(ctx context.Context, request DeleteSchemaRequest) error
- func (s Service) GetSchema(ctx context.Context, request GetSchemaRequest) (*GetSchemaResponse, error)
- func (s Service) ListSchemas(ctx context.Context, request ListSchemasRequest) (*ListSchemasResponse, error)
- func (s Service) Resolve(ctx context.Context, id string) (*schema.JSONSchema, schema.VCJSONSchemaType, error)
- func (s Service) Status() framework.Status
- func (s Service) Type() framework.Type
- type Storage
- func (s *Storage) DeleteSchema(ctx context.Context, id string) error
- func (s *Storage) GetSchema(ctx context.Context, id string) (*StoredSchema, error)
- func (s *Storage) ListSchemas(ctx context.Context, page common.Page) (*StoredSchemas, error)
- func (s *Storage) StoreSchema(ctx context.Context, schema StoredSchema) error
- type StoredSchema
- type StoredSchemas
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)
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewSchemaStorage ¶
func NewSchemaStorage(db storage.ServiceStorage) (*Storage, error)
func (*Storage) ListSchemas ¶
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 }
Click to show internal directories.
Click to hide internal directories.