didstorage

package
v0.0.0-...-add3e8a Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DIDFromProps

func DIDFromProps(id string, keys []KeyInput, services []did.Service) (*did.Document, error)

Types

type DIDStore

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

func NewDIDStore

func NewDIDStore(storage Storage) *DIDStore

func (*DIDStore) Delete

func (d *DIDStore) Delete(id string) error

func (*DIDStore) Register

func (d *DIDStore) Register(doc *did.Document) error

func (*DIDStore) Resolve

func (d *DIDStore) Resolve(id string) (*did.Document, error)

type KeyInput

type KeyInput struct {
	Purposes           []string               `json:"purposes"`
	VerificationMethod did.VerificationMethod `json:"verificationMethod"`
}

type PaymentResponse

type PaymentResponse struct {
	PaymentHash    string `json:"payment_hash"`
	PaymentRequest string `json:"payment_request"`
}

type RegisterStore

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

func NewRegisterStore

func NewRegisterStore(apiHost, apiKey string, storage Storage) *RegisterStore

func (*RegisterStore) Get

func (s *RegisterStore) Get(doc *did.Document) (string, bool)

func (*RegisterStore) Paid

func (s *RegisterStore) Paid(id string) (*did.Document, error)

func (*RegisterStore) Register

func (s *RegisterStore) Register(doc *did.Document) (*PaymentResponse, error)

type Storage

type Storage interface {
	Set(id string, value []byte) error
	Get(id string) ([]byte, error)
	Delete(id string) error
}

Jump to

Keyboard shortcuts

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