cloudapi

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://fault.jabbey.io"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(baseURL string, apiKey string, opts ...Option) *Client

func (*Client) AnalyzeConfidence

func (c *Client) AnalyzeConfidence(ctx context.Context, diffSummary string) (*llm.ConfidenceResult, error)

func (*Client) AnalyzeSpec

func (c *Client) AnalyzeSpec(ctx context.Context, spec string, diffSummary string) (*llm.SpecResult, error)

func (*Client) AnalyzeSpecStructured

func (c *Client) AnalyzeSpecStructured(ctx context.Context, specYAML string, diffSummary string, specTitle ...string) (*llm.StructuredSpecResult, error)

AnalyzeSpecStructured sends a structured per-requirement spec comparison request.

func (*Client) PullOrgConfig added in v0.7.0

func (c *Client) PullOrgConfig(ctx context.Context, orgSlug string) (string, error)

PullOrgConfig fetches the org's shared config YAML.

func (*Client) UploadRun

func (c *Client) UploadRun(ctx context.Context, run *RunUpload) error

UploadRun sends audit results to the Fault Cloud API.

type Option

type Option func(*Client)

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

func WithTimeout

func WithTimeout(d time.Duration) Option

type RunUpload

type RunUpload struct {
	RepoURL         string           `json:"repo_url"`
	Branch          string           `json:"branch"`
	CommitSHA       string           `json:"commit_sha"`
	CommitRange     string           `json:"commit_range"`
	DurationMs      int64            `json:"duration_ms"`
	FilesChanged    int              `json:"files_changed"`
	Issues          []analyzer.Issue `json:"issues"`
	ConfidenceScore *float64         `json:"confidence_score,omitempty"`
	Summary         string           `json:"summary"`
	Metadata        map[string]any   `json:"metadata,omitempty"`
	OrgID           string           `json:"org_id,omitempty"`
}

RunUpload contains the data sent to the Fault Cloud when uploading an audit run.

Jump to

Keyboard shortcuts

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