Help us shape the future of Go! Take the 2026 Go Developer Survey

hooks

package
v2.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package hooks provides hook implementations for the parti library.

This package contains various hook implementations that can be used with the Manager to receive lifecycle event notifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNop

func NewNop() types.Hooks

NewNop creates a new no-op hooks implementation.

Returns:

  • types.Hooks: Hooks with no-op implementations

Types

type NopHooks

type NopHooks struct{}

NopHooks implements Hooks with no-op callbacks.

This is the default implementation used when no custom hooks are provided, eliminating the need for nil checks throughout the codebase.

func (*NopHooks) OnAssignmentChanged

func (h *NopHooks) OnAssignmentChanged(ctx context.Context, oldp, newp []types.Partition) error

OnAssignmentChanged is a no-op implementation.

func (*NopHooks) OnError

func (h *NopHooks) OnError(ctx context.Context, err error) error

OnError is a no-op implementation.

func (*NopHooks) OnStateChanged

func (h *NopHooks) OnStateChanged(ctx context.Context, from, to types.State) error

OnStateChanged is a no-op implementation.

Jump to

Keyboard shortcuts

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