Help us shape the future of Go! Take the 2026 Go Developer Survey

watch

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package watch detects changes in how a site treats AI agents between runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	URL     string `json:"url"`
	Profile string `json:"profile,omitempty"` // empty for score changes
	From    string `json:"from"`
	To      string `json:"to"`
	// Worse is true when the change reduces agent access.
	Worse bool `json:"worse"`
}

Change is one difference between two runs for the same URL.

func Diff

func Diff(prev, cur *types.ComparisonResult, minScoreDelta int) []Change

Diff compares two reports for the same URL. Score changes smaller than minScoreDelta points are ignored.

func (Change) String

func (c Change) String() string

type Notifier

type Notifier struct {
	URL string
	// Format is "json" (default) or "slack" (Slack incoming webhook, also
	// accepted by Mattermost, Discord's /slack endpoint and others).
	Format string
	Client *http.Client
}

Notifier posts change alerts to a webhook.

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, changes []Change) error

Notify sends changes. It does nothing when there are none.

type Payload

type Payload struct {
	Event     string    `json:"event"` // always "acurl.changes"
	Timestamp time.Time `json:"timestamp"`
	Changes   []Change  `json:"changes"`
}

Payload is the JSON body sent to generic webhooks.

Jump to

Keyboard shortcuts

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