server

package
v0.0.0-...-965783e Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomness

func GetRandomness(numBytes int) (string, error)

GetRandomness returns numBytes bytes of randomness, expressed as a base64-encoded string.

func InMemCache

func InMemCache() evego.Cache

InMemCache returns a new cache object that the Eve-Central interface will use to cache returned results.

func Logger

func Logger(c *web.C, h http.Handler) http.Handler

Logger returns a Goji web middleware that logs web transactions in the format I want.

func StartJobs

func StartJobs(localdb db.LocalDB)

StartJobs starts the background jobs to update universe information.

func Submit

func Submit(job func())

Submit submits a job to the default (global) pool.

Types

type Sessionizer

type Sessionizer interface {
	// GetSession returns the client's session, creating a new one if necessary.
	GetSession(c *web.C, w http.ResponseWriter, r *http.Request) *db.Session
}

Sessionizer is an object that provides a client's session.

func GetSessionizer

func GetSessionizer(cookieDomain, cookiePath string, isProduction bool, db db.LocalDB) Sessionizer

GetSessionizer returns a Sessionizer to be passed to handlers.

type ThreadPool

type ThreadPool interface {
	// Submit takes the job passed as input and schedules it for execution on an
	// available goroutine.
	Submit(func())

	// Quit terminates the workers and then the threadpool.
	Quit()
}

ThreadPool distributes jobs to workers.

func StartPool

func StartPool(numWorkers int) ThreadPool

StartPool starts a new thread pool.

type Worker

type Worker struct {
	ID          int
	Work        chan func()
	WorkerQueue chan chan func()
	Quit        chan bool
}

Worker is our worker.

func (*Worker) Start

func (w *Worker) Start()

Start starts the specified worker.

func (*Worker) Stop

func (w *Worker) Stop()

Stop signals the specified worker to stop once it has finished the current job.

Jump to

Keyboard shortcuts

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