worker

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Package worker implements the worker side of Mettle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunForever

func RunForever(requestQueue, responseQueue, name, storage, dir, cacheDir, browserURL, sandbox string, clean, secureStorage bool, timeout time.Duration, maxCacheSize int64)

RunForever runs the worker, receiving jobs until terminated.

Types

type Cache

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

A Cache implements a filesystem-based blob cache. Since all the blobs are keyed by hash we don't have to worry about invalidation. In normal use the server never writes it; we prefill a selected artifact list offline.

func NewCache

func NewCache(root string) *Cache

NewCache returns a new cache instance.

func (*Cache) MustStoreAll

func (c *Cache) MustStoreAll(filename, storage string, secureStorage bool)

MustStoreAll is like StoreAll but dies on errors.

func (*Cache) Retrieve

func (c *Cache) Retrieve(key, dest string, mode os.FileMode) bool

Retrieve copies a blob from the cache to the given location. It returns true if retrieved.

func (*Cache) StoreAll

func (c *Cache) StoreAll(filename, storage string, secureStorage bool) error

StoreAll reads the given file and stores all the blobs it finds into the cache.

Jump to

Keyboard shortcuts

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