token

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: Apache-2.0 Imports: 2 Imported by: 14

Documentation

Overview

Package token contains necessary logic for passing messages. The Engine will issue a token.Context with a unique ID and sends it to the reader. The New function injects a unique ID into the context and returns it. All readers/recorders should use this ID for returning errors and logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
}

Context is a context.Context with a token as its value. IDEA: add current time. Then log the creation time if required.

func New

func New(ctx context.Context) *Context

New constructs a ReadJob with the provided context.

func (*Context) ID

func (c *Context) ID() ID

ID returns the recorded value in the c.

type ID

type ID uuid.UUID

ID is a unique ID. Only the Engine issues this ID and you should pass it along as you receive.

func NewUID

func NewUID() ID

NewUID returns a new unique ID.

func (ID) String

func (i ID) String() string

Jump to

Keyboard shortcuts

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