services

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNetworkIsNotSupported   = errors.New("network is not supported")
	ErrProofTypeIsNotSupported = errors.New("proof is not supported")

	ErrResolverAlreadyExists = errors.New("resolver already exists")

	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type DIDResolutionProver added in v0.0.5

type DIDResolutionProver interface {
	Prove(did w3c.DID, info IdentityState, dataType StateType) (document.DidResolutionProof, error)
}

type DIDResolutionProverRegistry added in v0.0.5

type DIDResolutionProverRegistry map[verifiable.ProofType]DIDResolutionProver

func NewDIDResolutionProverRegistry added in v0.0.5

func NewDIDResolutionProverRegistry() *DIDResolutionProverRegistry

func (*DIDResolutionProverRegistry) Add added in v0.0.5

func (*DIDResolutionProverRegistry) Append added in v0.0.5

func (*DIDResolutionProverRegistry) GetDIDResolutionProverByProofType added in v0.0.5

func (ch *DIDResolutionProverRegistry) GetDIDResolutionProverByProofType(proofType verifiable.ProofType) (DIDResolutionProver, error)

type DidDocumentOption added in v0.0.5

type DidDocumentOption func(*DidDocumentServices)

func WithProvers added in v0.0.5

func WithProvers(provers *DIDResolutionProverRegistry) DidDocumentOption

type DidDocumentServices

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

func NewDidDocumentServices

func NewDidDocumentServices(resolvers *ResolverRegistry, registry *ens.Registry, opts ...DidDocumentOption) *DidDocumentServices

func (*DidDocumentServices) GetDidDocument

func (d *DidDocumentServices) GetDidDocument(ctx context.Context, did string, opts *ResolverOpts) (*document.DidResolution, error)

GetDidDocument return did document by identifier.

func (*DidDocumentServices) GetGist

func (d *DidDocumentServices) GetGist(ctx context.Context, chain, network string, opts *ResolverOpts) (*verifiable.GistInfo, error)

func (*DidDocumentServices) ResolveDNSDomain

func (d *DidDocumentServices) ResolveDNSDomain(ctx context.Context, domain string) (*document.DidResolution, error)

ResolveDNSDomain return did document by domain via DNS.

func (*DidDocumentServices) ResolveENSDomain

func (d *DidDocumentServices) ResolveENSDomain(ctx context.Context, domain string) (*document.DidResolution, error)

ResolveENSDomain return did document via ENS resolver.

type GistInfo

type GistInfo struct {
	Root                *big.Int
	ReplacedByRoot      *big.Int
	CreatedAtTimestamp  *big.Int
	ReplacedAtTimestamp *big.Int
	CreatedAtBlock      *big.Int
	ReplacedAtBlock     *big.Int
}

func (*GistInfo) ToDidRepresentation

func (gi *GistInfo) ToDidRepresentation() (*verifiable.GistInfo, error)

type IdentityState

type IdentityState struct {
	StateInfo *StateInfo
	GistInfo  *GistInfo
}

type Resolver

type Resolver interface {
	Resolve(ctx context.Context, did w3c.DID, opts *ResolverOpts) (IdentityState, error)
	ResolveGist(ctx context.Context, opts *ResolverOpts) (*GistInfo, error)
	BlockchainID() string
}

type ResolverOpts

type ResolverOpts struct {
	State     *big.Int
	GistRoot  *big.Int
	Signature string
}

type ResolverRegistry

type ResolverRegistry map[string]Resolver

func NewChainResolvers

func NewChainResolvers() *ResolverRegistry

func (*ResolverRegistry) Add

func (ch *ResolverRegistry) Add(prefix string, resolver Resolver)

func (*ResolverRegistry) Append

func (ch *ResolverRegistry) Append(prefix string, resolver Resolver) error

func (*ResolverRegistry) GetResolverByNetwork

func (ch *ResolverRegistry) GetResolverByNetwork(chain, networkID string) (Resolver, error)

type StateInfo

type StateInfo struct {
	ID                  w3c.DID
	State               *big.Int
	ReplacedByState     *big.Int
	CreatedAtTimestamp  *big.Int
	ReplacedAtTimestamp *big.Int
	CreatedAtBlock      *big.Int
	ReplacedAtBlock     *big.Int
}

func (*StateInfo) ToDidRepresentation

func (si *StateInfo) ToDidRepresentation() (*verifiable.StateInfo, error)

type StateType added in v0.0.5

type StateType int32
const (
	IdentityStateType StateType = 0
	GlobalStateType   StateType = 1
)

Directories

Path Synopsis
blockchain
eth
eth/contract/mock
Package mock_eth is a generated GoMock package.
Package mock_eth is a generated GoMock package.
ens

Jump to

Keyboard shortcuts

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