interval

package
v2.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidMessageType = errors.New(`invalid message type`)

ErrInvalidMessageType defines the message value extracting error

Functions

func MessageValue

func MessageValue(m any) any

MessageValue take the target value from the message

func NewSubscriber

func NewSubscriber(timeInterval time.Duration, options ...Option) nc.Subscriber

NewSubscriber with interval message generation

Types

type Option

type Option func(opt *Options)

Option func type

func WithErrorHandler

func WithErrorHandler(h nc.ErrorHandler) Option

WithErrorHandler set handler of error processing

func WithHandler

func WithHandler(h handler) Option

WithHandler set custom message generation function

func WithPanicHandler

func WithPanicHandler(h nc.PanicHandler) Option

WithPanicHandler set handler of panic processing

type Options

type Options struct {
	// Handler generates message by time interval
	Handler handler

	// ErrorHandler of message processing
	ErrorHandler nc.ErrorHandler

	// PanicHandler process panic
	PanicHandler nc.PanicHandler
}

Options time interval wrapper

Jump to

Keyboard shortcuts

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