pico

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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

func NewClient(baseURL string) *Client

NewClient creates a new Pico API client. baseURL is the full tenant endpoint URL (e.g., "https://demo.api.us.kusari.cloud").

func NewClientFromWorkspace

func NewClientFromWorkspace() (*Client, error)

NewClientFromWorkspace creates a Pico client using the stored workspace configuration. It loads the workspace and extracts the tenant to initialize the client.

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

func (c *Client) GetSoftwareByID(ctx context.Context, softwareID int) (json.RawMessage, error)

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) SearchPackages

func (c *Client) SearchPackages(ctx context.Context, name, version string) (json.RawMessage, error)

SearchPackages searches for packages by name.

type RepoInfo

type RepoInfo struct {
	Forge       string
	Org         string
	Repo        string
	SubrepoPath string
}

RepoInfo contains repository information extracted from git.

func ExtractGitRemoteInfo

func ExtractGitRemoteInfo(repoPath string) (*RepoInfo, error)

ExtractGitRemoteInfo extracts forge, org, repo, and subrepo_path from git remote. If repoPath is empty, it uses the current working directory.

Jump to

Keyboard shortcuts

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