unique

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package unique builds the identity of unique jobs from their options.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOptions   = errors.New("unique: invalid options")
	ErrArgsNotCanonical = errors.New("foreman: unique args not canonical")
)

Functions

func Identity

func Identity(kind, queue string, args []byte, o Options, now time.Time) ([]byte, error)

Identity builds the identity object that Postgres hashes into the unique key.

func Mask

func Mask(states []job.State) string

func ParseMask

func ParseMask(mask string) []job.State

func PeriodBucket

func PeriodBucket(now time.Time, period time.Duration) int64

Types

type Options

type Options struct {
	ByArgs      bool
	ByArgFields []string
	ByPeriod    time.Duration
	ByQueue     bool
	ByState     []job.State
}

Options selects what makes a job unique.

func (Options) States

func (o Options) States() []job.State

func (Options) Validate

func (o Options) Validate() error

Jump to

Keyboard shortcuts

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