plugincache

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	Path string `yaml:"path" json:"path"`
}

CacheConfig is a plugin cache configuration

type PluginCache

type PluginCache struct {
	Config CacheConfig
	// contains filtered or unexported fields
}

PluginCache is a model plugin cache

func NewPluginCache

func NewPluginCache(config CacheConfig, resolver *pluginmodule.Resolver) (*PluginCache, error)

NewPluginCache creates a new plugin cache

func (*PluginCache) Entry added in v0.4.0

func (c *PluginCache) Entry(name configmodel.Name, version configmodel.Version) *PluginEntry

Entry returns the entry for the given plugin name+version

type PluginEntry added in v0.4.0

type PluginEntry struct {
	Path string
	// contains filtered or unexported fields
}

PluginEntry is an entry for a plugin in the cache

func (*PluginEntry) Cached added in v0.4.0

func (e *PluginEntry) Cached() (bool, error)

Cached returns whether the plugin is cached

func (*PluginEntry) IsLocked added in v0.4.0

func (e *PluginEntry) IsLocked() bool

IsLocked checks whether the cache is write locked

func (*PluginEntry) IsRLocked added in v0.4.0

func (e *PluginEntry) IsRLocked() bool

IsRLocked checks whether the cache is read locked

func (*PluginEntry) Load added in v0.4.0

Load loads the plugin from the cache

func (*PluginEntry) Lock added in v0.4.0

func (e *PluginEntry) Lock(ctx context.Context) error

Lock acquires a write lock on the cache

func (*PluginEntry) RLock added in v0.4.0

func (e *PluginEntry) RLock(ctx context.Context) error

RLock acquires a read lock on the cache

func (*PluginEntry) RUnlock added in v0.4.0

func (e *PluginEntry) RUnlock(ctx context.Context) error

RUnlock releases a read lock on the cache

func (*PluginEntry) Unlock added in v0.4.0

func (e *PluginEntry) Unlock(ctx context.Context) error

Unlock releases a write lock from the cache

Jump to

Keyboard shortcuts

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