stream

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2018 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context carries stream related variables across stream and its associated modules. Its methods are safe for simultaneous use by multiple goroutines.

func NewContext

func NewContext() *Context

NewContext returns an initialized stream context.

func (*Context) Bool

func (ctx *Context) Bool(key string) bool

Bool retrieves from the context a previously stored boolean value.

func (*Context) DoOnce

func (ctx *Context) DoOnce(handler string, f func())

DoOnce allows to execute a handler associated function only once in a concurrently safe manner.

func (*Context) Done

func (ctx *Context) Done() <-chan struct{}

Done returns a channel that is closed when the stream is terminated.

func (*Context) Float

func (ctx *Context) Float(key string) float64

Float retrieves from the context a previously stored floating point value.

func (*Context) Int

func (ctx *Context) Int(key string) int

Int retrieves from the context a previously stored integer value.

func (*Context) Object

func (ctx *Context) Object(key string) interface{}

Object retrieves from the context a previously stored object reference.

func (*Context) SetBool

func (ctx *Context) SetBool(boolean bool, key string)

SetBool stores within the context a boolean value.

func (*Context) SetFloat

func (ctx *Context) SetFloat(float float64, key string)

SetFloat stores within the context a floating point value.

func (*Context) SetInt

func (ctx *Context) SetInt(integer int, key string)

SetInt stores within the context an integer value.

func (*Context) SetObject

func (ctx *Context) SetObject(object interface{}, key string)

SetObject stores within the context an object reference.

func (*Context) SetString

func (ctx *Context) SetString(s string, key string)

SetString stores within the context an string value.

func (*Context) String

func (ctx *Context) String(key string) string

String retrieves from the context a previously stored string value.

func (*Context) Terminate

func (ctx *Context) Terminate()

Terminate will signal stream termination.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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