event

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultScheduleDelay is how long events should delay before generating.
	DefaultScheduleDelay = 5 * time.Second
)

Variables

This section is empty.

Functions

func Stream

func Stream(ctx context.Context, streamer Streamer, forceCh <-chan bool, generators []octant.Generator, requestPath, contentPath string) error

Types

type ContentGenerator

type ContentGenerator struct {
	// ResponseFactory is a function that generates a content response.
	ResponseFactory func(ctx context.Context, path, prefix, namespace string, opts module.ContentOptions) (component.ContentResponse, error)

	// Path is the path to the content.
	Path string

	// Prefix the API path prefix. It could be prepended to the path to create
	// a resolvable path.
	Prefix string

	// Namespace is the current namespace.
	Namespace string

	// LabelSet is a label set to filter any content.
	LabelSet *labels.Set

	// RunEvery is how often the event generator should be run.
	RunEvery time.Duration
	// contains filtered or unexported fields
}

ContentGenerator generates content events.

func (*ContentGenerator) Event

func (g *ContentGenerator) Event(ctx context.Context) (octant.Event, error)

Event generates content events.

func (*ContentGenerator) IsRunning

func (g *ContentGenerator) IsRunning() bool

IsRunning returns true if content is being generated.

func (*ContentGenerator) Name

func (*ContentGenerator) Name() string

Name returns the name of this generator.

func (*ContentGenerator) ScheduleDelay

func (g *ContentGenerator) ScheduleDelay() time.Duration

ScheduleDelay returns how long to delay before running this generator again.

type NamespacesGenerator

type NamespacesGenerator struct {
	// NamespaceClient is a namespaces client.
	NamespaceClient cluster.NamespaceInterface
}

NamespacesGenerator generates namespaces events.

func (*NamespacesGenerator) Event

Event generates namespaces events

func (NamespacesGenerator) Name

func (NamespacesGenerator) Name() string

Name returns the generator's name.

func (NamespacesGenerator) ScheduleDelay

func (NamespacesGenerator) ScheduleDelay() time.Duration

ScheduleDelay returns how long to delay before running this generator again.

type NavigationGenerator struct {
	// Modules is a list of modules to generate navigation from.
	Modules []module.Module

	// Namespace is the current namespace
	Namespace string

	// RunEvery is how often the event generator should be run.
	RunEvery time.Duration
}

NavigationGenerator generates navigation events.

Event generates a navigation event.

func (NavigationGenerator) Name() string

Name return the name of this generator.

func (g *NavigationGenerator) ScheduleDelay() time.Duration

ScheduleDelay returns how long to delay before running this generator again.

type Streamer

type Streamer interface {
	Stream(ctx context.Context, ch <-chan octant.Event)
}

Jump to

Keyboard shortcuts

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