dedupe

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Mode          Mode
	LookbackCount int
	OverlapCheck  bool
}

func ConfigFromEnv

func ConfigFromEnv() (Config, error)

ConfigFromEnv reads deduplication configuration from environment variables.

  • CLOCKIFY_DEDUPE_MODE: "warn" (default), "block", "off" — case-insensitive
  • CLOCKIFY_DEDUPE_LOOKBACK: default 25, must be > 0
  • CLOCKIFY_OVERLAP_CHECK: "true"/"1"/"warn" (default true), "false"/"0"/"off"

type DuplicateResult

type DuplicateResult struct {
	IsDuplicate     bool
	ExistingEntryID string
}

func CheckDuplicate

func CheckDuplicate(entries []clockify.TimeEntry, description, projectID, startISO string) *DuplicateResult

CheckDuplicate checks whether a proposed time entry duplicates an existing one. A duplicate is defined as an exact match on all three of:

  1. Description (case-insensitive)
  2. ProjectID (or both empty)
  3. Start time to the minute (first 16 chars of ISO 8601)

type Mode

type Mode int
const (
	Warn Mode = iota
	Block
	Off
)

type OverlapResult

type OverlapResult struct {
	HasOverlap     bool
	OverlapEntryID string
	Description    string
}

func CheckOverlap

func CheckOverlap(entries []clockify.TimeEntry, projectID, startISO, endISO string) *OverlapResult

CheckOverlap checks whether a proposed time range overlaps with any existing entry on the same project. Running timers (empty end time) are skipped. String comparison works for ISO 8601 timestamps.

Jump to

Keyboard shortcuts

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