state

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidTransition = fmt.Errorf("invalid transition")

Functions

This section is empty.

Types

type Attr

type Attr = map[string]any

type Candidate

type Candidate struct {
	ID         ID
	Attributes Attr
}

type Canonical

type Canonical struct {
	ID ID
}

type CreateCandidate

type CreateCandidate struct {
	ID ID
}

type Duplicate

type Duplicate struct {
	ID          ID
	CanonicalID ID
}

type ID

type ID = string

type Machine

type Machine struct {
	// contains filtered or unexported fields
}

func NewMachine

func NewMachine() *Machine

func (*Machine) Apply

func (m *Machine) Apply(s Transition) error

func (*Machine) LastError

func (m *Machine) LastError() error

func (*Machine) VisitCreateCandidate

func (m *Machine) VisitCreateCandidate(v *CreateCandidate) any

func (*Machine) VisitMarkAsCanonical

func (m *Machine) VisitMarkAsCanonical(v *MarkAsCanonical) any

func (*Machine) VisitMarkAsDuplicate

func (m *Machine) VisitMarkAsDuplicate(v *MarkAsDuplicate) any

func (*Machine) VisitMarkAsUnique

func (m *Machine) VisitMarkAsUnique(v *MarkAsUnique) any

type MarkAsCanonical

type MarkAsCanonical struct{}

type MarkAsDuplicate

type MarkAsDuplicate struct{ CanonicalID ID }

type MarkAsUnique

type MarkAsUnique struct{}

type Unique

type Unique struct {
	ID ID
}

Jump to

Keyboard shortcuts

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