Documentation
¶
Index ¶
- type Client
- func (c *Client) AssignSoftwareToComponent(ctx context.Context, compID int, softwareIDs []int) error
- func (c *Client) CreateComponent(ctx context.Context, name, displayName string, meta map[string]any) (json.RawMessage, error)
- func (c *Client) DeleteComponent(ctx context.Context, compID int) error
- func (c *Client) GetComponentByID(ctx context.Context, compID int) (json.RawMessage, error)
- func (c *Client) GetPackagesWithLifecycle(ctx context.Context, params map[string]string) (json.RawMessage, error)
- func (c *Client) GetSoftwareByID(ctx context.Context, softwareID int) (json.RawMessage, error)
- func (c *Client) GetSoftwareIDsByRepo(ctx context.Context, forge, org, repo, subrepoPath string) (json.RawMessage, error)
- func (c *Client) GetSoftwareList(ctx context.Context, search string, page, size int) (json.RawMessage, error)
- func (c *Client) GetSoftwareVulnerabilities(ctx context.Context, softwareID, page, size int) (json.RawMessage, error)
- func (c *Client) GetSoftwareVulnerabilityByID(ctx context.Context, softwareID, vulnID int) (json.RawMessage, error)
- func (c *Client) GetVulnerabilities(ctx context.Context, search string, kusariScore string, page, size int) (json.RawMessage, error)
- func (c *Client) GetVulnerabilityByExternalID(ctx context.Context, externalID string) (json.RawMessage, error)
- func (c *Client) ListComponents(ctx context.Context, params map[string]string) (json.RawMessage, error)
- func (c *Client) RemoveSoftwareFromComponent(ctx context.Context, compID, softwareID int) error
- func (c *Client) SearchPackages(ctx context.Context, name, version string) (json.RawMessage, error)
- func (c *Client) UpdateComponent(ctx context.Context, compID int, displayName *string, meta map[string]any) error
- type RepoInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles HTTP requests to the Kusari Pico API.
func NewClient ¶
NewClient creates a new Pico API client. baseURL is the full tenant endpoint URL (e.g., "https://demo.api.us.kusari.cloud").
func NewClientFromWorkspace ¶
NewClientFromWorkspace creates a Pico client using the stored workspace configuration. It loads the workspace and extracts the tenant to initialize the client.
func (*Client) AssignSoftwareToComponent ¶ added in v2.1.0
func (c *Client) AssignSoftwareToComponent(ctx context.Context, compID int, softwareIDs []int) error
AssignSoftwareToComponent bulk-assigns the given software IDs to the component. The request is atomic — if any software ID does not exist, no changes are made.
func (*Client) CreateComponent ¶ added in v2.1.0
func (c *Client) CreateComponent(ctx context.Context, name, displayName string, meta map[string]any) (json.RawMessage, error)
CreateComponent creates a new component. displayName and meta are optional (pass "" / nil to omit).
func (*Client) DeleteComponent ¶ added in v2.1.0
DeleteComponent deletes a component, unassigning any linked software first.
func (*Client) GetComponentByID ¶ added in v2.1.0
GetComponentByID retrieves a specific component by ID.
func (*Client) GetPackagesWithLifecycle ¶
func (c *Client) GetPackagesWithLifecycle(ctx context.Context, params map[string]string) (json.RawMessage, error)
GetPackagesWithLifecycle retrieves packages filtered by lifecycle status.
func (*Client) GetSoftwareByID ¶
GetSoftwareByID retrieves detailed information about a specific software by ID.
func (*Client) GetSoftwareIDsByRepo ¶
func (c *Client) GetSoftwareIDsByRepo(ctx context.Context, forge, org, repo, subrepoPath string) (json.RawMessage, error)
GetSoftwareIDsByRepo finds software IDs by repository metadata (forge, org, repo, subrepo_path). subrepoPath is optional - pass empty string to query all software in the repository.
func (*Client) GetSoftwareList ¶
func (c *Client) GetSoftwareList(ctx context.Context, search string, page, size int) (json.RawMessage, error)
GetSoftwareList retrieves a list of software with optional search filter.
func (*Client) GetSoftwareVulnerabilities ¶
func (c *Client) GetSoftwareVulnerabilities(ctx context.Context, softwareID, page, size int) (json.RawMessage, error)
GetSoftwareVulnerabilities retrieves vulnerabilities for a specific software by ID.
func (*Client) GetSoftwareVulnerabilityByID ¶
func (c *Client) GetSoftwareVulnerabilityByID(ctx context.Context, softwareID, vulnID int) (json.RawMessage, error)
GetSoftwareVulnerabilityByID retrieves detailed information about how a specific vulnerability affects a specific software.
func (*Client) GetVulnerabilities ¶
func (c *Client) GetVulnerabilities(ctx context.Context, search string, kusariScore string, page, size int) (json.RawMessage, error)
GetVulnerabilities retrieves vulnerabilities with optional filters.
func (*Client) GetVulnerabilityByExternalID ¶
func (c *Client) GetVulnerabilityByExternalID(ctx context.Context, externalID string) (json.RawMessage, error)
GetVulnerabilityByExternalID retrieves vulnerability details by external ID (CVE, GHSA, etc.).
func (*Client) ListComponents ¶ added in v2.1.0
func (c *Client) ListComponents(ctx context.Context, params map[string]string) (json.RawMessage, error)
ListComponents retrieves a list of components with optional filters. params keys correspond to the OpenAPI query parameters (search, status_filter, filter, sort, tags, exclude_tags, has_tags, page, size). Empty values are omitted.
func (*Client) RemoveSoftwareFromComponent ¶ added in v2.1.0
RemoveSoftwareFromComponent removes the link between a single software and a component. Returns an error wrapping the API 404 if no such link exists.
func (*Client) SearchPackages ¶
SearchPackages searches for packages by name.
type RepoInfo ¶
RepoInfo contains repository information extracted from git.
func ExtractGitRemoteInfo ¶
ExtractGitRemoteInfo extracts forge, org, repo, and subrepo_path from git remote. If repoPath is empty, it uses the current working directory.