Documentation
¶
Index ¶
- Constants
- func DidToDocUrl(plcURL, did string) (string, error)
- func NormalizePlcURL(raw string) (string, error)
- func ResolveHandle(ctx context.Context, cli *http.Client, handle string) (string, error)
- func ResolveHandleFromTXT(ctx context.Context, handle string) (string, error)
- func ResolveHandleFromWellKnown(ctx context.Context, cli *http.Client, handle string) (string, error)
- func ResolveService(ctx context.Context, cli *http.Client, plcURL, did string) (string, error)
- type BackingCache
- type DidAuditEntry
- type DidAuditLog
- type DidData
- type DidDoc
- type DidDocService
- type DidDocVerificationMethod
- type DidLog
- type DidLogEntry
- type MemCache
- func (mc *MemCache) BustDid(handle string) error
- func (mc *MemCache) BustDoc(did string) error
- func (mc *MemCache) GetDid(handle string) (string, bool)
- func (mc *MemCache) GetDoc(did string) (*DidDoc, bool)
- func (mc *MemCache) PutDid(handle string, did string) error
- func (mc *MemCache) PutDoc(did string, doc *DidDoc) error
- type OperationService
- type Passport
- type PassportOption
Constants ¶
const DefaultPlcURL = "https://plc.directory"
DefaultPlcURL is the public PLC directory used when no override is configured.
Variables ¶
This section is empty.
Functions ¶
func DidToDocUrl ¶
DidToDocUrl returns the URL of the DID document for did. did:plc documents are fetched from plcURL (DefaultPlcURL when empty).
func NormalizePlcURL ¶ added in v0.11.4
NormalizePlcURL validates a PLC directory base URL and returns it without a trailing slash. An empty value yields DefaultPlcURL. Plain http is accepted so a local PLC directory can be used for testing.
func ResolveHandle ¶
func ResolveHandleFromTXT ¶
Types ¶
type BackingCache ¶
type DidAuditEntry ¶
type DidAuditEntry struct {
Did string `json:"did"`
Operation DidLogEntry `json:"operation"`
Cid string `json:"cid"`
Nullified bool `json:"nullified"`
CreatedAt string `json:"createdAt"`
}
type DidData ¶
type DidDoc ¶
type DidDoc struct {
Context []string `json:"@context"`
Id string `json:"id"`
AlsoKnownAs []string `json:"alsoKnownAs"`
VerificationMethods []DidDocVerificationMethod `json:"verificationMethod"`
Service []DidDocService `json:"service"`
}
type DidDocService ¶
type DidLog ¶
type DidLog []DidLogEntry
type DidLogEntry ¶
type DidLogEntry struct {
Sig string `json:"sig"`
Prev *string `json:"prev"`
Type string `json:"string"`
Services map[string]OperationService `json:"services"`
AlsoKnownAs []string `json:"alsoKnownAs"`
RotationKeys []string `json:"rotationKeys"`
VerificationMethods map[string]string `json:"verificationMethods"`
}
type MemCache ¶
type MemCache struct {
// contains filtered or unexported fields
}
func NewMemCache ¶
type OperationService ¶
type Passport ¶
type Passport struct {
// contains filtered or unexported fields
}
func NewPassport ¶
func NewPassport(h *http.Client, bc BackingCache, opts ...PassportOption) *Passport
NewPassport uses restricted web fetching and a separate client for the configured PLC directory. An explicit client overrides both defaults.
type PassportOption ¶ added in v0.11.4
type PassportOption func(*Passport)
PassportOption configures optional Passport behavior.
func WithPlcURL ¶ added in v0.11.4
func WithPlcURL(plcURL string) PassportOption
WithPlcURL sets the PLC directory used to resolve did:plc documents. An empty value keeps DefaultPlcURL.