worker

package
v0.0.0-...-57e9fdd Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package worker impelements worker goroutines to generate random values. The value will be used by blackbox agent for file encryption/decryption.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateValue

func GenerateValue(size int) (string, error)

func ParseRequest

func ParseRequest(r io.Reader) (string, error)

Types

type Pair

type Pair struct {
	Key   string
	Value string
}

type Worker

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

func NewWorker

func NewWorker(p chan net.Conn, r chan Pair, c *cache.Cache) *Worker

Create worker

func (*Worker) Loop

func (w *Worker) Loop()

Worker looping to get pending connection and then doWork. It also receives stopping signal to terminate.

func (*Worker) Stop

func (w *Worker) Stop() error

Stop worker goroutine, it passes an chan error to worker.Stopping to get error back from worker.

Jump to

Keyboard shortcuts

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