Documentation
¶
Index ¶
- Constants
- Variables
- func NewFileCache(d identity.Directory, cleaner CacheCleaner, dir string) *cacheDirectory
- func Purge(ctx context.Context, db *sql.DB) error
- type CacheCleaner
- type CacheConfig
- type DIDCache
- func (cache *DIDCache) CacheDoc(ctx context.Context, did string, doc *did.Document, prevResult *Result) error
- func (cache *DIDCache) CachedDoc(ctx context.Context, didstr string) (*Result, error)
- func (cache *DIDCache) Clear(ctx context.Context) error
- func (cache *DIDCache) ClearEntry(ctx context.Context, did string) error
- func (cache *DIDCache) ClearHandle(ctx context.Context, handle string) error
- func (cache *DIDCache) Close() error
- func (cache *DIDCache) GetDID(ctx context.Context, handle string) (*Result, error)
- func (cache *DIDCache) GetIdentity(ctx context.Context, did string) (*IdentityResult, error)
- func (cache *DIDCache) InitializeSchema() error
- func (cache *DIDCache) SetLogger(l *slog.Logger)
- func (cache *DIDCache) StoreDID(ctx context.Context, handle, did string) error
- func (cache *DIDCache) StoreIdentity(ctx context.Context, did string, ident *identity.Identity) error
- type Directory
- func (d *Directory) Lookup(ctx context.Context, i syntax.AtIdentifier) (*identity.Identity, error)
- func (d *Directory) LookupDID(ctx context.Context, did syntax.DID) (*identity.Identity, error)
- func (d *Directory) LookupHandle(ctx context.Context, h syntax.Handle) (*identity.Identity, error)
- func (d *Directory) Purge(ctx context.Context, i syntax.AtIdentifier) error
- type HandleResolver
- type IdentityResult
- type Resolver
- type Result
Constants ¶
View Source
const DIDMaxLen = 2 * 1024
Variables ¶
Functions ¶
func NewFileCache ¶
func NewFileCache(d identity.Directory, cleaner CacheCleaner, dir string) *cacheDirectory
Types ¶
type CacheCleaner ¶
type CacheConfig ¶
type CacheConfig struct{}
type DIDCache ¶
type DIDCache struct {
// contains filtered or unexported fields
}
func NewDIDCache ¶
func NewDIDCacheFromDB ¶
func (*DIDCache) ClearEntry ¶
func (*DIDCache) ClearHandle ¶
func (*DIDCache) GetIdentity ¶
func (*DIDCache) InitializeSchema ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
func NewDirectory ¶
func (*Directory) LookupHandle ¶
type HandleResolver ¶
type HandleResolver struct {
// contains filtered or unexported fields
}
func NewHandleResolver ¶
func NewHandleResolver(resolver atp.HandleResolver, cache *DIDCache) *HandleResolver
func (*HandleResolver) ResolveHandle ¶
type IdentityResult ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) FlushCacheFor ¶
type Result ¶
type Result struct {
Doc did.Document
UpdatedAt time.Time
DID string
// If stale is true but expired is false, the entry is still usable but
// should be refreshed soon.
Stale bool
// If expired is true, the entry is considered invalid and should not be
// used without refreshing or replacing it.
Expired bool
}
Click to show internal directories.
Click to hide internal directories.