worker

package
v5.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0 Imports: 41 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(instanceName, requestQueue, responseQueue, name, storage, dir, cacheDir, cacheSrcDir, browserURL, sandbox, lucidity, tokenFile string, clean, secureStorage, cacheCopy bool, timeout time.Duration, maxCacheSize, minDiskSpace int64)

RunForever runs the worker, receiving jobs until terminated.

func RunOne

func RunOne(instanceName, name, storage, dir, cacheDir, cacheSrcDir, sandbox, tokenFile string, clean, secureStorage, cacheCopy bool, timeout time.Duration, hash string, size int64) error

RunOne runs one single request, returning any error received.

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, src string, copy bool) *Cache

NewCache returns a new cache instance.

func (*Cache) MustStoreAll

func (c *Cache) MustStoreAll(instanceName string, targets []string, storage string, secureStorage bool, tokenFile string, minDiskSpace int64)

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(instanceName string, targets []string, storage string, secureStorage bool, tokenFile string, minDiskSpace int64) 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