thread

package
v0.0.0-...-581b1ea Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package thread contains code for interacting with a single stenotype thread.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Thread

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

Thread watches the environment of a single stenotype thread. Stenotype runs multiple threads, each of which interacts with a specific set of directories in the environment. Each stenotype thread has a corresponding Thread object server-side which watches for file changes, cleans up old/dead files, etc.

func Threads

func Threads(configs []config.ThreadConfig, baseDir string, fc *filecache.Cache) ([]*Thread, error)

Threads creates a set of thread objects based on a set of ThreadConfigs.

func (*Thread) ExportDebugHandlers

func (t *Thread) ExportDebugHandlers(mux *http.ServeMux)

ExportDebugHandlers exports a set of HTTP handlers on /debug/t<thread id> for querying internal state from this thread.

func (*Thread) FileLastSeen

func (t *Thread) FileLastSeen() time.Time

FileLastSeen returns the last timne this thread saw a new file from stenotype.

func (*Thread) Lookup

func (t *Thread) Lookup(ctx context.Context, q query.Query) *base.PacketChan

Lookup looks up packets that match a given query within the files owned by a single stenotype thread.

func (*Thread) SyncFiles

func (t *Thread) SyncFiles()

SyncFiles checks the disk to see if stenotype has created any new files, or if old files should be deleted.

Jump to

Keyboard shortcuts

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