platformcommand

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: GPL-3.0 Imports: 10 Imported by: 0 modules, 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

Index

Constants

View Source
const ProposalType = "platform_command_proposal"

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogResolver

type CatalogResolver interface {
	GetProject(ctx context.Context, id uuid.UUID) (catalogdomain.Project, error)
	ListProjects(ctx context.Context, organizationID uuid.UUID) ([]catalogdomain.Project, error)
}

type Command

type Command struct {
	Name CommandName
	Args any
}

func (Command) Payload

func (c Command) Payload() map[string]any

type CommandName

type CommandName string
const (
	CommandProjectUpdateCreate CommandName = "project_update.create"
	CommandTicketUpdate        CommandName = "ticket.update"
	CommandTicketCreate        CommandName = "ticket.create"
)

type ExecutionResult

type ExecutionResult struct {
	CommandIndex int            `json:"command_index"`
	Command      map[string]any `json:"command"`
	Ok           bool           `json:"ok"`
	Summary      string         `json:"summary"`
	Detail       string         `json:"detail,omitempty"`
}

type Executor

type Executor struct {
	Tickets        TicketExecutor
	ProjectUpdates ProjectUpdateExecutor
}

func (Executor) Execute

func (e Executor) Execute(
	ctx context.Context,
	index int,
	command Command,
	resolved ResolvedCommand,
	executedBy string,
) ExecutionResult

type ProjectUpdateCreateArgs

type ProjectUpdateCreateArgs struct {
	Project string
	Content string
	Title   string
	Status  string
}

type ProjectUpdateExecutor

type ProjectUpdateExecutor interface {
	AddThread(ctx context.Context, input projectupdateservice.AddThreadInput) (projectupdateservice.Thread, error)
}

type Proposal

type Proposal struct {
	Summary  string
	Commands []Command
}

func ParseProposal

func ParseProposal(payload map[string]any) (Proposal, error)

type ResolvedCommand

type ResolvedCommand struct {
	Name CommandName
	Args any
}

type ResolvedProjectUpdateCreateArgs

type ResolvedProjectUpdateCreateArgs struct {
	ProjectID   uuid.UUID
	ProjectName string
	Content     string
	Title       string
	Status      projectupdateservice.Status
}

type ResolvedTicketCreateArgs

type ResolvedTicketCreateArgs struct {
	ProjectID        uuid.UUID
	ProjectName      string
	Title            string
	Description      string
	StatusID         *uuid.UUID
	StatusName       *string
	ParentTicketID   *uuid.UUID
	ParentIdentifier *string
}

type ResolvedTicketUpdateArgs

type ResolvedTicketUpdateArgs struct {
	TicketID         uuid.UUID
	TicketIdentifier string
	Title            *string
	Description      *string
	StatusID         *uuid.UUID
	StatusName       *string
}

type Resolver

type Resolver struct {
	Catalog  CatalogResolver
	Tickets  TicketResolver
	Statuses StatusResolver
}

func (Resolver) ResolveCommand

func (r Resolver) ResolveCommand(
	ctx context.Context,
	currentProject catalogdomain.Project,
	command Command,
) (ResolvedCommand, error)

type StatusResolver

type StatusResolver interface {
	List(ctx context.Context, projectID uuid.UUID) (ticketstatusservice.ListResult, error)
}

type TicketCreateArgs

type TicketCreateArgs struct {
	Project      string
	Title        string
	Description  string
	Status       *string
	ParentTicket *string
}

type TicketExecutor

type TicketExecutor interface {
	Create(ctx context.Context, input ticketservice.CreateInput) (ticketservice.Ticket, error)
	Update(ctx context.Context, input ticketservice.UpdateInput) (ticketservice.Ticket, error)
}

type TicketResolver

type TicketResolver interface {
	List(ctx context.Context, input ticketservice.ListInput) ([]ticketservice.Ticket, error)
}

type TicketUpdateArgs

type TicketUpdateArgs struct {
	Ticket      string
	Title       *string
	Description *string
	Status      *string
}

Jump to

Keyboard shortcuts

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