Documentation ¶
Index ¶
- Constants
- type CreateSchemaRequest
- type CreateSchemaResponse
- type DeleteSchemaRequest
- type GetSchemaRequest
- type GetSchemaResponse
- type GetSchemasResponse
- type Service
- func (s Service) Config() config.SchemaServiceConfig
- func (s Service) CreateSchema(request CreateSchemaRequest) (*CreateSchemaResponse, error)
- func (s Service) DeleteSchema(request DeleteSchemaRequest) error
- func (s Service) GetSchema(request GetSchemaRequest) (*GetSchemaResponse, error)
- func (s Service) GetSchemas() (*GetSchemasResponse, error)
- func (s Service) Resolve(id string) (*schema.VCJSONSchema, error)
- func (s Service) Status() framework.Status
- func (s Service) Type() framework.Type
- func (s Service) VerifySchema(request VerifySchemaRequest) (*VerifySchemaResponse, error)
- type Storage
- type StoredSchema
- type VerifySchemaRequest
- type VerifySchemaResponse
Constants ¶
View Source
const (
Version1 string = "1.0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSchemaRequest ¶
type CreateSchemaRequest struct { Author string `json:"author" validate:"required"` Name string `json:"name" validate:"required"` Schema schema.JSONSchema `json:"schema" validate:"required"` Sign bool `json:"signed"` }
func (CreateSchemaRequest) IsValid ¶
func (csr CreateSchemaRequest) IsValid() bool
type CreateSchemaResponse ¶
type CreateSchemaResponse struct { ID string `json:"id"` Schema schema.VCJSONSchema `json:"schema"` SchemaJWT *keyaccess.JWT `json:"schemaJwt,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"` Schema schema.VCJSONSchema `json:"schema"` SchemaJWT *keyaccess.JWT `json:"schemaJwt,omitempty"` }
type GetSchemasResponse ¶
type GetSchemasResponse 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 *didsdk.Resolver) (*Service, error)
func (Service) Config ¶
func (s Service) Config() config.SchemaServiceConfig
func (Service) CreateSchema ¶
func (s Service) CreateSchema(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 JSONSchema specification. TODO(gabe) support data integrity proof generation on schemas, versioning, and more
func (Service) DeleteSchema ¶
func (s Service) DeleteSchema(request DeleteSchemaRequest) error
func (Service) GetSchema ¶
func (s Service) GetSchema(request GetSchemaRequest) (*GetSchemaResponse, error)
func (Service) GetSchemas ¶
func (s Service) GetSchemas() (*GetSchemasResponse, error)
func (Service) VerifySchema ¶
func (s Service) VerifySchema(request VerifySchemaRequest) (*VerifySchemaResponse, error)
VerifySchema verifies a schema's signature and makes sure the schema is compliant with the specification
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewSchemaStorage ¶
func NewSchemaStorage(db storage.ServiceStorage) (*Storage, error)
func (*Storage) DeleteSchema ¶
func (*Storage) GetSchemas ¶
func (ss *Storage) GetSchemas() ([]StoredSchema, error)
GetSchemas 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(schema StoredSchema) error
type StoredSchema ¶
type StoredSchema struct { ID string `json:"id"` Schema schema.VCJSONSchema `json:"schema"` SchemaJWT *keyaccess.JWT `json:"token,omitempty"` }
type VerifySchemaRequest ¶
type VerifySchemaResponse ¶
Click to show internal directories.
Click to hide internal directories.