env

package
v0.0.0-...-d4b3ac2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Overview

Package env contains the environment that stenographer will set up and run. This is the main part of the stenographer server, setting up stenotype's environment and running it, and serving all HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {

	// StenotypeOutput is the writer that stenotype STDOUT/STDERR will be
	// redirected to.
	StenotypeOutput io.Writer
	// contains filtered or unexported fields
}

Env contains information necessary to run Stenotype.

func New

func New(c config.Config) (_ *Env, returnedErr error)

New returns a new Env for use in running Stenotype.

func (*Env) Close

func (d *Env) Close() error

Close closes the directory. This should only be done when stenotype has stopped using it. After this call, Env should no longer be used.

func (*Env) ExportDebugHandlers

func (d *Env) ExportDebugHandlers(mux *http.ServeMux)

ExportDebugHandlers exports a few debugging handlers to an HTTP ServeMux.

func (*Env) Lookup

func (d *Env) Lookup(ctx context.Context, q query.Query) *base.PacketChan

Lookup looks up the given query in all blockfiles currently known in this Env.

func (*Env) MinLastFileSeen

func (d *Env) MinLastFileSeen() time.Time

MinLastFileSeen returns the timestamp of the oldest among the newest files created by all threads.

func (*Env) Path

func (d *Env) Path() string

Path returns the underlying directory path for the given Env.

func (*Env) RunStenotype

func (d *Env) RunStenotype()

RunStenotype keeps the stenotype binary running, restarting it if necessary but trying not to allow crash loops.

func (*Env) Serve

func (e *Env) Serve() error

Serve starts up an HTTP server using http.DefaultServerMux to handle requests. This server will server over TLS, using the certs stored in c.CertPath to verify itself to clients and verify clients.

Jump to

Keyboard shortcuts

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