Documentation ¶
Index ¶
- type CreateSchemaRequest
- type CreateSchemaResponse
- type DeleteSchemaRequest
- type GetSchemaRequest
- type GetSchemaResponse
- type ListSchemasResponse
- type Service
- func (s Service) Config() config.SchemaServiceConfig
- 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) (*ListSchemasResponse, error)
- func (s Service) Resolve(ctx context.Context, id string) (*schema.JSONSchema, error)
- func (s Service) Status() framework.Status
- func (s Service) Type() framework.Type
- type Storage
- func (ss *Storage) DeleteSchema(ctx context.Context, id string) error
- func (ss *Storage) GetSchema(ctx context.Context, id string) (*StoredSchema, error)
- func (ss *Storage) ListSchemas(ctx context.Context) ([]StoredSchema, error)
- func (ss *Storage) StoreSchema(ctx context.Context, schema StoredSchema) error
- type StoredSchema
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"` // If sign == true, the schema will be signed by the author's private key with the specified KID Sign bool `json:"sign,omitempty"` Issuer string `json:"issuer,omitempty"` IssuerKID string `json:"issuerKid,omitempty"` }
func (CreateSchemaRequest) IsValid ¶
func (csr CreateSchemaRequest) IsValid() bool
type CreateSchemaResponse ¶
type CreateSchemaResponse struct { ID string `json:"id"` Schema schema.JSONSchema `json:"schema"` }
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"` Schema schema.JSONSchema `json:"schema"` }
type ListSchemasResponse ¶
type ListSchemasResponse struct {
Schemas []GetSchemaResponse `json:"schemas,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewSchemaService ¶
func NewSchemaService(config config.SchemaServiceConfig, s storage.ServiceStorage, keyStore *keystore.Service, resolver resolution.Resolver) (*Service, error)
func (Service) Config ¶
func (s Service) Config() config.SchemaServiceConfig
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 SchemaID specification. TODO(gabe) support data integrity proofs for credential schemas
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) (*ListSchemasResponse, error)
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewSchemaStorage ¶
func NewSchemaStorage(db storage.ServiceStorage) (*Storage, error)
func (*Storage) DeleteSchema ¶
func (*Storage) ListSchemas ¶
func (ss *Storage) ListSchemas(ctx context.Context) ([]StoredSchema, 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 (ss *Storage) StoreSchema(ctx context.Context, schema StoredSchema) error
type StoredSchema ¶
type StoredSchema struct { ID string `json:"id"` Schema schema.JSONSchema `json:"schema"` }
Click to show internal directories.
Click to hide internal directories.