Documentation
¶
Index ¶
- func ApplyRuntimeConfig(cmd *cobra.Command, raw config.Raw)
- func BuildWriteExecutionResult(spec WriteExecutionSpec) map[string]any
- func BuildWritePreview(spec WriteOperationSpec) map[string]any
- func Execute(opts RootOptions) error
- func NewCommand() *cobra.Command
- func NewRootCommand(opts RootOptions) *cobra.Command
- func RenderJSON(v any) ([]byte, error)
- func ValidateConfirmation(spec ProtectedWriteSpec, confirm string) error
- func ValidateWriteConfirmation(got string, expected string) error
- type AuthenticationManifest
- type BootstrapManifest
- type CLIError
- type Client
- func (c *Client) CallRPC(ctx context.Context, method string, params any, out any) error
- func (c *Client) DoJSON(ctx context.Context, method, path string, query map[string]string, body any) (*HTTPResponse, error)
- func (c *Client) Download(ctx context.Context, methodID string, query any) (*DownloadedFile, error)
- func (c *Client) UploadFile(ctx context.Context, methodID string, fileName string, reader io.Reader) (*UploadedFile, error)
- func (c *Client) UploadFileWithFields(ctx context.Context, methodID string, fileName string, reader io.Reader, ...) (*UploadedFile, error)
- type CommandManifest
- type Config
- type ConfigOptions
- type ConfigSource
- type DownloadedFile
- type ErrorEnvelope
- type Filters
- type HTTPResponse
- type ManifestArgument
- type ManifestCommand
- type ManifestExample
- type ManifestFlag
- type ManifestInputConstraint
- type ProtectedWritePreview
- type ProtectedWriteSpec
- type RootOptions
- type SuccessEnvelope
- type TimeRange
- type TimeRangeOptions
- type UploadedFile
- type WriteExecutionSpec
- type WriteOperationSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildWriteExecutionResult ¶
func BuildWriteExecutionResult(spec WriteExecutionSpec) map[string]any
func BuildWritePreview ¶
func BuildWritePreview(spec WriteOperationSpec) map[string]any
func Execute ¶
func Execute(opts RootOptions) error
func NewCommand ¶
NewCommand creates the T-Answer product command for chaitin-cli.
func NewRootCommand ¶
func NewRootCommand(opts RootOptions) *cobra.Command
NewRootCommand is kept for product-level tests that exercise the full chaitin-cli tanswer command path.
func RenderJSON ¶
func ValidateConfirmation ¶
func ValidateConfirmation(spec ProtectedWriteSpec, confirm string) error
Types ¶
type AuthenticationManifest ¶
type AuthenticationManifest struct {
URL ConfigSource `json:"url"`
APIKey ConfigSource `json:"api_key"`
Timeout ConfigSource `json:"timeout"`
Insecure ConfigSource `json:"insecure"`
Precedence []string `json:"precedence"`
StatusCommand string `json:"status_command"`
VerifyCommand string `json:"verify_command"`
}
type BootstrapManifest ¶
type BootstrapManifest struct {
Authentication AuthenticationManifest `json:"authentication"`
AgentProtocol []string `json:"agent_protocol"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) UploadFile ¶
type CommandManifest ¶
type CommandManifest struct {
SchemaVersion string `json:"schema_version"`
Product string `json:"product"`
Binary string `json:"binary"`
Namespace string `json:"namespace"`
Env map[string]string `json:"env"`
Bootstrap BootstrapManifest `json:"bootstrap"`
Commands []ManifestCommand `json:"commands"`
}
func BuildCommandManifest ¶
func BuildCommandManifest() CommandManifest
type Config ¶
func LoadConfig ¶
func LoadConfig(opts ConfigOptions) (Config, error)
type ConfigOptions ¶
type ConfigSource ¶
type DownloadedFile ¶
type ErrorEnvelope ¶
type HTTPResponse ¶
type HTTPResponse struct {
StatusCode int `json:"status_code"`
Header http.Header `json:"-"`
Body json.RawMessage `json:"body"`
}
type ManifestArgument ¶
type ManifestCommand ¶
type ManifestCommand struct {
Name string `json:"name"`
FullCommand string `json:"full_command"`
Layer string `json:"layer"`
Summary string `json:"summary"`
UseWhen []string `json:"use_when"`
DoNotUseWhen []string `json:"do_not_use_when,omitempty"`
Arguments []ManifestArgument `json:"arguments,omitempty"`
Flags []ManifestFlag `json:"flags,omitempty"`
InputConstraints []ManifestInputConstraint `json:"input_constraints,omitempty"`
OutputType string `json:"output_type"`
OutputFields []string `json:"output_fields"`
PreviewOutputFields []string `json:"preview_output_fields,omitempty"`
RiskLevel string `json:"risk_level"`
RequiresConfirmation bool `json:"requires_confirmation"`
ConfirmationCondition string `json:"confirmation_condition,omitempty"`
Examples []ManifestExample `json:"examples"`
Backend map[string]interface{} `json:"backend,omitempty"`
}
type ManifestExample ¶
type ManifestFlag ¶
type ManifestInputConstraint ¶
type ProtectedWritePreview ¶
type ProtectedWritePreview struct {
RequiresConfirmation bool `json:"requires_confirmation"`
Confirmed bool `json:"confirmed"`
OperationType string `json:"operation_type"`
Target any `json:"target"`
ChangeSummary []string `json:"change_summary"`
Impact []string `json:"impact"`
RiskWarnings []string `json:"risk_warnings,omitempty"`
ConfirmationToken string `json:"confirmation_token"`
}
func BuildProtectedWritePreview ¶
func BuildProtectedWritePreview(spec ProtectedWriteSpec, confirm string) ProtectedWritePreview
type ProtectedWriteSpec ¶
type RootOptions ¶
type SuccessEnvelope ¶
type TimeRange ¶
type TimeRange struct {
Type string `json:"type"`
Start int64 `json:"start"`
End int64 `json:"end"`
}
func ParseTimeRange ¶
func ParseTimeRange(opts TimeRangeOptions) (TimeRange, error)
type TimeRangeOptions ¶
type UploadedFile ¶
type UploadedFile struct {
StatusCode int `json:"status_code"`
Header http.Header `json:"-"`
Body json.RawMessage `json:"body"`
}
type WriteExecutionSpec ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.