exampleoptional

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "example-optional"

Variables

This section is empty.

Functions

This section is empty.

Types

type ExampleOptional

type ExampleOptional struct{}

ExampleOptional demonstrates allowed-failure behavior. It fails immediately but is marked as an allowed failure, so it doesn't take down the rest of the app. Useful pattern for non-critical services like metrics exporters, cache warmers, or analytics collectors.

func New

func New() (*ExampleOptional, error)

func (*ExampleOptional) IsAllowedFailure

func (o *ExampleOptional) IsAllowedFailure() bool

IsAllowedFailure makes ExampleOptional implement the AllowedFailure interface. Its failure won't bring down the service manager.

func (*ExampleOptional) Name

func (o *ExampleOptional) Name() string

func (*ExampleOptional) Run

func (o *ExampleOptional) Run(
	ctx context.Context,
) error

func (*ExampleOptional) Stop

func (o *ExampleOptional) Stop(
	ctx context.Context,
) error

Jump to

Keyboard shortcuts

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