unit

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package unit names the units of work the Slack plugin and the host share: a provider and the provider's key, as the host's units are.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b Unit) int

Compare orders a and b as Less does.

Types

type Anchor

type Anchor struct {
	Unit      Unit      `json:"unit"`
	Ref       string    `json:"ref"` // slack "<conversation>/<ts>"; github "review:<id>", "comment:<id>", "commit:<oid>", "situation:<kind>"; "turn:<round>"; "row:<rev>"; "draft:<id>", "draft:<id>:<kind>" before v4
	Permalink string    `json:"permalink,omitempty"`
	At        time.Time `json:"at,omitzero"`
}

Anchor is a plugin's opaque reference to a message or event inside a unit.

func (Anchor) Valid

func (a Anchor) Valid() error

Valid says why a is not an anchor: Ref non-blank, one line, at most 300 bytes; Unit non-zero.

type ProviderID

type ProviderID string

type Unit

type Unit struct {
	Provider ProviderID `json:"provider"`
	Key      string     `json:"key"`
}

func Of

func Of(w plugin.Unit) Unit

Of is the unit the protocol names w.

func (Unit) IsZero

func (u Unit) IsZero() bool

func (Unit) Less

func (u Unit) Less(o Unit) bool

Less orders by provider, then key; the sort order of every unit list.

func (Unit) String

func (u Unit) String() string

func (Unit) Wire

func (u Unit) Wire() plugin.Unit

Wire is u as the plugin protocol names it.

Jump to

Keyboard shortcuts

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