bond

package module
v0.0.0-...-5c9d87d Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 2 Imported by: 0

README

bond

A tiny monorepo-friendly core for typed contracts and temporal adapters.

Documentation

Index

Constants

View Source
const (
	Async Strategy = "async"
	Sync  Strategy = "sync"

	High Priority = "high"
	Low  Priority = "low"
)

Variables

View Source
var ErrTimeout = errors.New("timed out")

Functions

This section is empty.

Types

type Contract

type Contract[I, O any] struct {
	Version  string   // example: "v1", "v2"
	Priority Priority // example: "high", "low"
	Strategy Strategy
	Domain   string
	Name     string
}

func (Contract[I, O]) Activity

func (c Contract[I, O]) Activity() string

func (Contract[I, O]) Queue

func (c Contract[I, O]) Queue() string

func (Contract[I, O]) Workflow

func (c Contract[I, O]) Workflow() string

type Handler

type Handler[Input, Output any] interface {
	Handle(context.Context, Input) (Output, error)
}

type HandlerFunc

type HandlerFunc[I, O any] func(context.Context, I) (O, error)

func (HandlerFunc[I, O]) Handle

func (h HandlerFunc[I, O]) Handle(parent context.Context, input I) (O, error)

type Priority

type Priority string

type Strategy

type Strategy string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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