atp

package
v0.0.0-...-e6a591c Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDidDoc

func ConvertDidDoc(doc *did.Document) *identity.DIDDocument

func IdentityToDoc

func IdentityToDoc(i *identity.Identity) (*did.Document, error)

func NewDNSConfig

func NewDNSConfig(host string, port int) *dns.ClientConfig

func NewDefaultHandleResolver

func NewDefaultHandleResolver() (*handleResolver, error)

func NewHandleResolver

func NewHandleResolver(dnsConf *dns.ClientConfig, httpClient *http.Client, timeout time.Duration) *handleResolver

Types

type CreateOp

type CreateOp struct {
	Type        string  `json:"type" cborgen:"type" cbor:"type"`
	SigningKey  string  `json:"signingKey" cborgen:"signingKey" cbor:"signingKey"`
	RecoveryKey string  `json:"recoveryKey" cborgen:"recoveryKey" cbor:"recoveryKey"`
	Handle      string  `json:"handle" cborgen:"handle" cbor:"handle"`
	Service     string  `json:"service" cborgen:"service" cbor:"service"`
	Prev        *string `json:"prev" cborgen:"prev" cbor:"prev"`
	Sig         string  `json:"sig" cborgen:"sig,omitempty" cbor:"sig,omitempty"`
}

type DidResolver

type DidResolver interface {
	did.Resolver
	HandleResolver
}

type FakePLC

type FakePLC struct{ *Resolver }

func (*FakePLC) CreateDID

func (p *FakePLC) CreateDID(ctx context.Context, sigkey *did.PrivKey, recovery, handle, service string) (string, error)

func (*FakePLC) UpdateUserHandle

func (plc *FakePLC) UpdateUserHandle(ctx context.Context, didstr, nhandle string) error

type HandleResolver

type HandleResolver interface {
	ResolveHandle(ctx context.Context, handle string) (syntax.DID, error)
}

type PLC

type PLC struct {
	*Resolver
	Host string
}

func (*PLC) CreateDID

func (p *PLC) CreateDID(ctx context.Context, signingkey *did.PrivKey, recovery, handle, service string) (string, error)

func (*PLC) UpdateUserHandle

func (plc *PLC) UpdateUserHandle(ctx context.Context, didstr, nhandle string) error

type Resolver

type Resolver struct {
	HandleResolver
	PlcURL     *url.URL
	HttpClient *http.Client
}

func (*Resolver) FlushCacheFor

func (r *Resolver) FlushCacheFor(string)

func (*Resolver) GetDocument

func (r *Resolver) GetDocument(ctx context.Context, didstr string) (*did.Document, error)

func (*Resolver) Lookup

func (*Resolver) LookupDID

func (r *Resolver) LookupDID(ctx context.Context, did syntax.DID) (*identity.Identity, error)

func (*Resolver) LookupHandle

func (r *Resolver) LookupHandle(ctx context.Context, h syntax.Handle) (*identity.Identity, error)

func (*Resolver) Purge

func (r *Resolver) Purge(ctx context.Context, i syntax.AtIdentifier) error

Flushes any cache of the indicated identifier. If directory is not using caching, can ignore this.

func (*Resolver) ResolveDID

func (r *Resolver) ResolveDID(ctx context.Context, did syntax.DID) (*identity.DIDDocument, error)

Jump to

Keyboard shortcuts

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