state

package
v2.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package state provides filtering for workflow states.

Supported filters (7):

  • created-at: Filter by creation date (--created-after, --created-before)
  • updated-at: Filter by update date (--updated-after, --updated-before)
  • id: Filter by workflow state UUID (--id)
  • name: Filter by state name contains (--name)
  • description: Filter by description contains (--description)
  • type: Filter by state type (--type): triage, backlog, unstarted, started, completed, canceled
  • team: Filter by team name/key (--team)

Index

Constants

This section is empty.

Variables

View Source
var Filters = map[string]FilterFunc{

	"created-at": common.ApplyCreatedAt[*FilterBuilder],
	"updated-at": common.ApplyUpdatedAt[*FilterBuilder],

	"id":   common.ApplyID[*FilterBuilder],
	"team": ApplyTeam,

	"name":        ApplyName,
	"description": ApplyDescription,
	"type":        ApplyType,
}

Filters maps filter names to their apply functions. Uses shared filters from common package where applicable.

Functions

func ApplyDescription

func ApplyDescription(ctx context.Context, cmd *cobra.Command, b *FilterBuilder) error

ApplyDescription handles --description flag.

func ApplyName

func ApplyName(ctx context.Context, cmd *cobra.Command, b *FilterBuilder) error

ApplyName handles --name flag.

func ApplyTeam

func ApplyTeam(ctx context.Context, cmd *cobra.Command, b *FilterBuilder) error

ApplyTeam handles --team flag.

func ApplyType

func ApplyType(ctx context.Context, cmd *cobra.Command, b *FilterBuilder) error

ApplyType handles --type flag. Valid types: triage, backlog, unstarted, started, completed, canceled

Types

type FilterBuilder

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

FilterBuilder constructs WorkflowStateFilter from CLI flags.

func NewFilterBuilder

func NewFilterBuilder(res *resolver.Resolver) *FilterBuilder

NewFilterBuilder creates a FilterBuilder with the given resolver.

func (*FilterBuilder) Build

Build returns the filter if any fields are set, nil otherwise.

func (*FilterBuilder) CreatedAtComparator

func (b *FilterBuilder) CreatedAtComparator() *intgraphql.DateComparator

CreatedAtComparator returns or creates the CreatedAt comparator.

func (*FilterBuilder) Filter

Filter returns the underlying WorkflowStateFilter.

func (*FilterBuilder) FromFlags

func (b *FilterBuilder) FromFlags(ctx context.Context, cmd *cobra.Command) error

FromFlags populates the filter from cobra command flags.

func (*FilterBuilder) Parser

func (b *FilterBuilder) Parser() dateparser.Parser

Parser returns the date parser.

func (*FilterBuilder) Resolver

func (b *FilterBuilder) Resolver() *resolver.Resolver

Resolver returns the resolver for entity lookups.

func (*FilterBuilder) SetID

func (b *FilterBuilder) SetID(comp *intgraphql.IDComparator)

SetID sets the ID comparator. Implements common.IDFilterable.

func (*FilterBuilder) UpdatedAtComparator

func (b *FilterBuilder) UpdatedAtComparator() *intgraphql.DateComparator

UpdatedAtComparator returns or creates the UpdatedAt comparator.

type FilterFunc

type FilterFunc func(ctx context.Context, cmd *cobra.Command, b *FilterBuilder) error

FilterFunc applies a filter based on command flags.

Jump to

Keyboard shortcuts

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