sutureext

package
v0.0.0-...-72e33f6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventHook

func EventHook() suture.EventHook

func OneShotFunc

func OneShotFunc(fn func(ctx context.Context) error) func(ctx context.Context) error

func SanitizeError

func SanitizeError(ctx context.Context, err error) error

SanitizeError prevents the error from being interpreted as a context error unless it really is a context error because suture kills the service when it sees a context error.

Types

type ServiceContext

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

func NewServiceContext

func NewServiceContext(name string) ServiceContext

func (ServiceContext) Context

func (b ServiceContext) Context() context.Context

func (ServiceContext) Serve

func (b ServiceContext) Serve(ctx context.Context) error

func (ServiceContext) String

func (b ServiceContext) String() string

type ServiceFunc

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

func NewServiceFunc

func NewServiceFunc(name string, fn func(ctx context.Context) error) ServiceFunc

func (ServiceFunc) Serve

func (s ServiceFunc) Serve(ctx context.Context) error

func (ServiceFunc) String

func (s ServiceFunc) String() string

Jump to

Keyboard shortcuts

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