cache

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	validation.LicenseResolver
}

Cacher covers all interfaces which calls should be cached

type Direct

type Direct struct {
	validation.LicenseResolver
}

type MaybeEmpty added in v0.0.3

type MaybeEmpty struct {
	Empty bool
	Rcv   interface{}
}

MaybeEmpty is a helper for fetching not always existing keys radix.MaybeNil is not suitable for HGETALL currently

func (*MaybeEmpty) UnmarshalRESP added in v0.0.3

func (mn *MaybeEmpty) UnmarshalRESP(br *bufio.Reader) error

type MemLRU added in v0.0.3

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

func NewMemLRU added in v0.0.3

func NewMemLRU(backed Cacher, size int) (*MemLRU, error)

func (*MemLRU) ResolveLicense added in v0.0.3

func (ml *MemLRU) ResolveLicense(ctx context.Context, m validation.Module) (validation.License, error)

type MemoryCache

type MemoryCache struct {
	Backed Cacher
	// contains filtered or unexported fields
}

MemoryCache is a simple in-memory cache that holds license for project version It's needed because sometimes license recognition takes a lot of time

func (*MemoryCache) ResolveLicense

func (c *MemoryCache) ResolveLicense(ctx context.Context, m validation.Module) (validation.License, error)

type RedisCache added in v0.0.3

type RedisCache struct {
	Backed Cacher
	Client radix.Client
	TTL    time.Duration
}

func (*RedisCache) Check added in v0.0.8

func (rc *RedisCache) Check(ctx context.Context) error

func (*RedisCache) ResolveLicense added in v0.0.3

func (rc *RedisCache) ResolveLicense(ctx context.Context, m validation.Module) (validation.License, error)

Jump to

Keyboard shortcuts

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