api

package
v0.0.0-...-efe2ce5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0, MIT Imports: 26 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveDidToHandle

func ResolveDidToHandle(ctx context.Context, res did.Resolver, hr HandleResolver, udid string) (string, string, error)

Types

type CreateOp

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

func (*CreateOp) MarshalCBOR

func (t *CreateOp) MarshalCBOR(w io.Writer) error

func (*CreateOp) UnmarshalCBOR

func (t *CreateOp) UnmarshalCBOR(r io.Reader) (err error)

type HandleResolver

type HandleResolver interface {
	ResolveHandleToDid(ctx context.Context, handle string) (string, error)
}

type PLCServer

type PLCServer struct {
	Host string
	C    *http.Client
}

func (*PLCServer) CreateDID

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

func (*PLCServer) FlushCacheFor

func (s *PLCServer) FlushCacheFor(did string)

func (*PLCServer) GetDocument

func (s *PLCServer) GetDocument(ctx context.Context, didstr string) (*did.Document, error)

func (*PLCServer) UpdateUserHandle

func (s *PLCServer) UpdateUserHandle(ctx context.Context, did string, handle string) error

type ProdHandleResolver

type ProdHandleResolver struct {
	ReqMod    func(*http.Request, string) error
	FailCache *arc.ARCCache[string, *failCacheItem]
	// contains filtered or unexported fields
}

func NewProdHandleResolver

func NewProdHandleResolver(failureCacheSize int, resolveAddr string, forceUDP bool) (*ProdHandleResolver, error)

func (*ProdHandleResolver) ResolveHandleToDid

func (dr *ProdHandleResolver) ResolveHandleToDid(ctx context.Context, handle string) (string, error)

type TestHandleResolver

type TestHandleResolver struct {
	TrialHosts []string
}

func (*TestHandleResolver) ResolveHandleToDid

func (tr *TestHandleResolver) ResolveHandleToDid(ctx context.Context, handle string) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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