Documentation ¶
Index ¶
- Variables
- type DIDDoc
- type Service
- func (s Service) Get(ctx context.Context, did string) (types.DIDDocument, error)
- func (s Service) GetMetadataHistory(ctx context.Context, did string) (asset.DataArrayVersions, error)
- func (s Service) GetVerificationKeyByAuthID(ctx context.Context, did, authID string) (cryptotypes.PubKey, error)
- func (s Service) Register(ctx context.Context, did string, vm []types.VerificationMethod, a []string) error
- func (s Service) SaveMetadata(ctx context.Context, did string, m []asset.Object) error
- func (s Service) SaveVerificationMethods(ctx context.Context, did string, vms []types.VerificationMethod, a []string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDIDNotRegistered thows when requested DID is not present in registry ErrDIDNotRegistered = errors.New("DID is not registered") // ErrDIDAlreadyRegistered thows when system tries to register DID that is already registered ErrDIDAlreadyRegistered = errors.New("DID was already registered") // ErrVerificationKeyNotFound thows when requested verification key is not present in DID document ErrVerificationKeyNotFound = errors.New("unknown verification method") )
Functions ¶
This section is empty.
Types ¶
type DIDDoc ¶
type DIDDoc interface { // Register registers a new DID document in the registry Register(ctx context.Context, did string, vm []types.VerificationMethod, a []string) error // Get retrieves a DID document from the registry Get(ctx context.Context, did string) (types.DIDDocument, error) // GetMetadataHistory returns the history of asset data changes GetMetadataHistory(ctx context.Context, did string) (asset.DataArrayVersions, error) // SaveMetadata saves metadata to the registry SaveMetadata(ctx context.Context, did string, m []asset.Object) error // SaveVerificationMethods saves verification methods for patrticular DID SaveVerificationMethods(ctx context.Context, did string, vms []types.VerificationMethod, a []string) error // GetVerificationKeyByAuthID returns verification key by authentification ID GetVerificationKeyByAuthID(ctx context.Context, did, authID string) (cryptotypes.PubKey, error) }
DIDDoc defines an API for work with DID documents
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements DIDDoc
func NewService ¶
func NewService(db immudb.ImmuClient, logger *zap.SugaredLogger) *Service
NewService creates a new instance of DIDDoc service
func (Service) GetMetadataHistory ¶
func (s Service) GetMetadataHistory(ctx context.Context, did string) (asset.DataArrayVersions, error)
GetMetadataHistory implements DIDDoc GetMetadataHistory
func (Service) GetVerificationKeyByAuthID ¶
func (s Service) GetVerificationKeyByAuthID(ctx context.Context, did, authID string) (cryptotypes.PubKey, error)
GetVerificationKeyByAuthID implements DIDDoc GetVerificationKeyByAuthID
func (Service) Register ¶
func (s Service) Register(ctx context.Context, did string, vm []types.VerificationMethod, a []string) error
Register implements DIDDoc Register
func (Service) SaveMetadata ¶
SaveMetadata implements DIDDoc SaveMetadata
func (Service) SaveVerificationMethods ¶
func (s Service) SaveVerificationMethods(ctx context.Context, did string, vms []types.VerificationMethod, a []string) error
SaveVerificationMethods implements DIDDoc SaveVerificationMethods
Click to show internal directories.
Click to hide internal directories.