plugincache

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 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

NewPluginCache creates a new plugin cache

func (*PluginCache) Cached

func (c *PluginCache) Cached(name configmodel.Name, version configmodel.Version) (bool, error)

Cached returns whether the given plugin is cached

func (*PluginCache) GetPath

func (c *PluginCache) GetPath(name configmodel.Name, version configmodel.Version) (string, error)

GetPath gets the path of the given plugin

func (*PluginCache) IsLocked

func (c *PluginCache) IsLocked() bool

IsLocked checks whether the cache is write locked

func (*PluginCache) IsRLocked

func (c *PluginCache) IsRLocked() bool

IsRLocked checks whether the cache is read locked

func (*PluginCache) Load

Load loads a plugin from the cache

func (*PluginCache) Lock

func (c *PluginCache) Lock(ctx context.Context) error

Lock acquires a write lock on the cache

func (*PluginCache) RLock

func (c *PluginCache) RLock(ctx context.Context) error

RLock acquires a read lock on the cache

func (*PluginCache) RUnlock

func (c *PluginCache) RUnlock(ctx context.Context) error

RUnlock releases a read lock on the cache

func (*PluginCache) Unlock

func (c *PluginCache) 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