internal

package
v0.0.0-...-dd0b383 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GCD

func GCD(periods []int64) int64

Types

type CommandHandler

type CommandHandler interface {
	Exec(ctx context.Context) error
}

CommandHandler returns an error.

type CommandHandlerFunc

type CommandHandlerFunc func(ctx context.Context) error

func (CommandHandlerFunc) Exec

type QueryHandler

type QueryHandler[T any] interface {
	Exec(ctx context.Context) (T, error)
}

QueryHandler returns a value and an error.

type QueryHandlerFunc

type QueryHandlerFunc[T any] func(ctx context.Context) (T, error)

func (QueryHandlerFunc[T]) Exec

func (h QueryHandlerFunc[T]) Exec(ctx context.Context) (T, error)

type RequestHandler

type RequestHandler[T any] interface {
	Exec(ctx context.Context, t T) error
}

RequestHandler accepts a request, and returns an error.

type RequestHandlerFunc

type RequestHandlerFunc[T any] func(ctx context.Context, v T) error

func (RequestHandlerFunc[T]) Exec

func (h RequestHandlerFunc[T]) Exec(ctx context.Context, v T) error

func (RequestHandlerFunc[T]) ToCommandHandler

func (h RequestHandlerFunc[T]) ToCommandHandler(ctx context.Context, v T) CommandHandler

type RequestReplyHandler

type RequestReplyHandler[T, U any] interface {
	Exec(ctx context.Context, t T) (U, error)
}

RequestReplyHandler accepts a request, and returns a value and an error.

type RequestReplyHandlerFunc

type RequestReplyHandlerFunc[T, U any] func(ctx context.Context, v T) (U, error)

func (RequestReplyHandlerFunc[T, U]) Exec

func (h RequestReplyHandlerFunc[T, U]) Exec(ctx context.Context, v T) (U, error)

func (RequestReplyHandlerFunc[T, U]) ToQueryHandler

func (h RequestReplyHandlerFunc[T, U]) ToQueryHandler(ctx context.Context, v T) QueryHandler[U]

type SilentHandler

type SilentHandler interface {
	Exec(ctx context.Context)
}

SilentHandler is similar like CommandHandler, but returns no error.

type SilentRequestHandler

type SilentRequestHandler[T any] interface {
	Exec(ctx context.Context, t T)
}

SilentRequestHandler is similar like RequestHandler, but returns no error.

Jump to

Keyboard shortcuts

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