componenthelper

package
Version: v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Overview

Package componenthelper assists with the creation of a new component.Component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.24.0

func New(options ...Option) component.Component

New returns a component.Component configured with the provided options.

Types

type Option added in v0.24.0

type Option func(*baseComponent)

Option represents the possible options for New.

func WithShutdown added in v0.24.0

func WithShutdown(shutdownFunc ShutdownFunc) Option

WithShutdown overrides the default `Shutdown` function for a component.Component. The default always returns nil.

func WithStart added in v0.24.0

func WithStart(startFunc StartFunc) Option

WithStart overrides the default `Start` function for a component.Component. The default always returns nil.

type ShutdownFunc added in v0.25.0

type ShutdownFunc func(context.Context) error

ShutdownFunc specifies the function invoked when the component.Component is being shutdown.

func (ShutdownFunc) Shutdown added in v0.26.0

func (f ShutdownFunc) Shutdown(ctx context.Context) error

Shutdown shuts down the component.

type StartFunc added in v0.25.0

type StartFunc func(context.Context, component.Host) error

StartFunc specifies the function invoked when the component.Component is being started.

func (StartFunc) Start added in v0.26.0

func (f StartFunc) Start(ctx context.Context, host component.Host) error

Start starts the component.

Jump to

Keyboard shortcuts

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