cmd

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 52 Imported by: ? 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

This section is empty.

Variables

View Source
var (
	// Version information - set via ldflags at build time
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)
View Source
var ErrTooLong = errors.New("input exceeds limit")
View Source
var NAME = "conductor"

Functions

func AddOutputFlags

func AddOutputFlags(cmd *cobra.Command)

AddOutputFlags adds --json and --csv flags to a command

func EscapeCSV

func EscapeCSV(value string) string

EscapeCSV escapes a string value for CSV output Handles values containing commas, quotes, or newlines

func Execute

func Execute(ctx context.Context)

func ReadLineRaw

func ReadLineRaw(limit int) (string, error)

ReadLineRaw reads from stdin in raw mode until a newline is entered (accepts both '\n' and '\r'). It supports arbitrarily long lines up to `limit`. The terminal state is always restored before returning.

Types

type BoilerPlate

type BoilerPlate struct {
	Files []BoilerPlateFile `json:"files"`
}

type BoilerPlateFile

type BoilerPlateFile struct {
	Name   string  `json:"name"`
	Fields []Field `json:"fields"`
	Mode   string  `json:"mode,omitempty"`
}

type CSVWriter

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

CSVWriter wraps csv.Writer with helper methods

func NewCSVWriter

func NewCSVWriter() *CSVWriter

NewCSVWriter creates a new CSV writer that writes to stdout

func (*CSVWriter) Flush

func (c *CSVWriter) Flush()

Flush flushes the CSV writer

func (*CSVWriter) WriteHeader

func (c *CSVWriter) WriteHeader(headers ...string)

WriteHeader writes the CSV header row

func (*CSVWriter) WriteRow

func (c *CSVWriter) WriteRow(values ...string)

WriteRow writes a CSV data row

type CachedTokenManager

type CachedTokenManager struct {
	Key    string
	Secret string
	// contains filtered or unexported fields
}

CachedTokenManager manages authentication tokens with caching It implements the TokenManager interface from conductor-go SDK

func NewCachedTokenManager

func NewCachedTokenManager(key, secret, cachedToken string, tokenExpiry int64, configPath string, httpSettings *settings.HttpSettings) *CachedTokenManager

NewCachedTokenManager creates a new CachedTokenManager

func (*CachedTokenManager) RefreshToken

func (m *CachedTokenManager) RefreshToken(httpSettings *settings.HttpSettings, httpClient *http.Client) (string, error)

RefreshToken implements the TokenManager interface Returns a valid token, fetching a new one if the cached token is expired

type ConfigTokenManager

type ConfigTokenManager struct {
	Token string
}

func (ConfigTokenManager) RefreshToken

func (manager ConfigTokenManager) RefreshToken(httpSettings *settings.HttpSettings, httpClient *http.Client) (string, error)

type Field

type Field struct {
	Name      string `json:"name"`
	Attribute string `json:"attribute"`
	Prompt    string `json:"prompt"`
}

type Framework

type Framework struct {
	Name      string     `json:"name"`
	Templates []Template `json:"templates"`
}

type Language

type Language struct {
	Name       string      `json:"name"`
	Frameworks []Framework `json:"frameworks"`
}

type OutputFormat

type OutputFormat string

OutputFormat represents the output format type

const (
	OutputFormatTable OutputFormat = "table"
	OutputFormatJSON  OutputFormat = "json"
	OutputFormatCSV   OutputFormat = "csv"
)

func GetOutputFormat

func GetOutputFormat(cmd *cobra.Command) (OutputFormat, error)

GetOutputFormat determines the output format from command flags Returns: format, error

type ServerUpdateState

type ServerUpdateState struct {
	LastCheck  time.Time `json:"last_check"`
	ETag       string    `json:"etag,omitempty"`
	ServerType string    `json:"server_type,omitempty"`
	Version    string    `json:"version,omitempty"`
	Port       int       `json:"port,omitempty"`
}

ServerUpdateState tracks the state of server update checks

type TaskResult

type TaskResult struct {
	Status string                 `json:"status"`
	Body   map[string]interface{} `json:"body"`
}

type Template

type Template struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Path        string `json:"path"`
}

type TemplateList

type TemplateList struct {
	Languages []Language `json:"languages"`
}

type WorkerCodeResponse

type WorkerCodeResponse struct {
	Id           string    `json:"id"`
	UserId       string    `json:"userId"`
	Namespace    string    `json:"namespace"`
	TaskName     string    `json:"taskName"`
	Language     string    `json:"language"`
	Code         string    `json:"code"`
	Version      int       `json:"version"`
	Description  string    `json:"description"`
	Dependencies []string  `json:"dependencies"`
	CreatedAt    time.Time `json:"createdAt"`
	UpdatedAt    time.Time `json:"updatedAt"`
	CreatedBy    string    `json:"createdBy"`
}

WorkerCodeResponse represents the response from the job-runner worker-code API

type WorkerMetadata

type WorkerMetadata struct {
	TaskName     string    `json:"taskName"`
	Language     string    `json:"language"`
	Version      int       `json:"version"`
	WorkerCodeId string    `json:"workerCodeId"`
	CachedAt     time.Time `json:"cachedAt"`
	UpdatedAt    time.Time `json:"updatedAt"`
}

WorkerMetadata represents cached worker metadata

type WorkerResult

type WorkerResult struct {
	Status string                 `json:"status"` // COMPLETED | FAILED | IN_PROGRESS
	Output map[string]interface{} `json:"output,omitempty"`
	Logs   []string               `json:"logs,omitempty"`
	Reason string                 `json:"reason,omitempty"`
}

WorkerResult represents the expected output from a worker command

Jump to

Keyboard shortcuts

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