Documentation
¶
Index ¶
- Variables
- func AddOutputFlags(cmd *cobra.Command)
- func EscapeCSV(value string) string
- func Execute(ctx context.Context)
- func ReadLineRaw(limit int) (string, error)
- type CSVWriter
- type CachedTokenManager
- type ConfigTokenManager
- type OutputFormat
- type ServerUpdateState
- type WorkerCodeResponse
- type WorkerMetadata
Constants ¶
This section is empty.
Variables ¶
var ( // Version information - set via ldflags at build time Version = "dev" Commit = "none" Date = "unknown" )
var ErrTooLong = errors.New("input exceeds limit")
var NAME = "conductor"
Functions ¶
func AddOutputFlags ¶
AddOutputFlags adds --json and --csv flags to a command
func EscapeCSV ¶
EscapeCSV escapes a string value for CSV output Handles values containing commas, quotes, or newlines
func ReadLineRaw ¶
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 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) WriteHeader ¶
WriteHeader writes the CSV header 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 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 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