doccache

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Invalidator

type Invalidator interface {
	Invalidate(uniqueSuffix string)
}

Invalidator invalidates the given key in the document cache

type Provider

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

Provider manages document caches - one per channel/namespace combination

func New

func New() *Provider

New returns a new document cache provider

func (*Provider) CreateCachingOperationProcessor

func (p *Provider) CreateCachingOperationProcessor(channelID string, cfg sidetreehandler.Config, target dochandler.OperationProcessor) dochandler.OperationProcessor

CreateCachingOperationProcessor updates the document cache for the given channel ID and namespace using the given configuration. The previous cache is replaced with the new one. The document cache stores the ResolutionResult in JSON format. Each document has an optional expiration which is specified in the Config.DocumentExpiry. If DocumentExpiry is 0 then the document never expires, but it still may be evicted to make room for other documents.

func (*Provider) GetDocumentInvalidator

func (p *Provider) GetDocumentInvalidator(channelID, namespace string) (Invalidator, error)

GetDocumentInvalidator returns the invalidator for the given channel and namespace

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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