cache

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LevelOpts defines gauge options for tracking cache level.
	LevelOpts = metrics.GaugeOpts{
		Name:       "cache_level",
		Help:       "Level of the idemix cache",
		LabelNames: []string{"network", "channel", "namespace"},
	}
)

Functions

This section is empty.

Types

type IdentityCache

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

IdentityCache provides a pre-provisioned cache of Idemix identities.

func NewIdentityCache

func NewIdentityCache(backed IdentityCacheBackendFunc, size int, auditInfo []byte, metrics *Metrics) *IdentityCache

NewIdentityCache creates a new identity cache with specified size and backend.

func (*IdentityCache) Close

func (c *IdentityCache) Close()

Close stops the background identity provisioning.

func (*IdentityCache) Identity

func (c *IdentityCache) Identity(ctx context.Context, auditInfo []byte) (*idriver.IdentityDescriptor, error)

Identity retrieves an identity from cache or generates on-demand.

type IdentityCacheBackendFunc

type IdentityCacheBackendFunc func(ctx context.Context, auditInfo []byte) (*idriver.IdentityDescriptor, error)

IdentityCacheBackendFunc generates an identity descriptor for given audit info.

type Metrics

type Metrics struct {
	// Current number of cached identities
	CacheLevelGauge metrics.Gauge
}

Metrics contains metrics for monitoring identity cache performance.

func NewMetrics

func NewMetrics(p metrics.Provider) *Metrics

NewMetrics creates a new Metrics instance.

Jump to

Keyboard shortcuts

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