{"modulePath":"github.com/vulnetix/cli","version":"v1.37.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Types\n\n```go\ntype Artifact struct {\n\tID                 int64     `json:\"id\"`\n\tNodeID             string    `json:\"node_id\"`\n\tName               string    `json:\"name\"`\n\tSizeInBytes        int64     `json:\"size_in_bytes\"`\n\tURL                string    `json:\"url\"`\n\tArchiveDownloadURL string    `json:\"archive_download_url\"`\n\tExpired            bool      `json:\"expired\"`\n\tCreatedAt          time.Time `json:\"created_at\"`\n\tUpdatedAt          time.Time `json:\"updated_at\"`\n\tExpiresAt          time.Time `json:\"expires_at\"`\n}\n```\nArtifact represents a GitHub Actions artifact\n\n```go\ntype ArtifactCollector struct {\n\t// contains filtered or unexported fields\n}\n```\nArtifactCollector handles collection of GitHub Actions artifacts\n\n```go\nfunc NewArtifactCollector(token, apiURL, repository, runID string) *ArtifactCollector\n```\nNewArtifactCollector creates a new artifact collector\n\n```go\nfunc (c *ArtifactCollector) DownloadArtifact(ctx context.Context, artifact Artifact) (string, error)\n```\nDownloadArtifact downloads an artifact and extracts it to a temporary directory\n\n```go\nfunc (c *ArtifactCollector) ListArtifacts(ctx context.Context) ([]Artifact, error)\n```\nListArtifacts lists all artifacts for the current workflow run\n\n```go\ntype ArtifactMetadata struct {\n\tRepository      string            `json:\"repository\"`\n\tRepositoryOwner string            `json:\"repository_owner\"`\n\tRunID           string            `json:\"run_id\"`\n\tRunNumber       string            `json:\"run_number\"`\n\tWorkflowName    string            `json:\"workflow_name\"`\n\tJobName         string            `json:\"job\"`\n\tSHA             string            `json:\"sha\"`\n\tRefName         string            `json:\"ref_name\"`\n\tRefType         string            `json:\"ref_type\"`\n\tEventName       string            `json:\"event_name\"`\n\tActor           string            `json:\"actor\"`\n\tServerURL       string            `json:\"server_url\"`\n\tAPIURL          string            `json:\"api_url\"`\n\tArtifacts       []string          `json:\"artifacts\"`\n\tExtraEnvVars    map[string]string `json:\"extra_env_vars,omitempty\"`\n}\n```\nArtifactMetadata contains metadata about the workflow and artifacts\n\n```go\nfunc CollectMetadata(artifactNames []string) *ArtifactMetadata\n```\nCollectMetadata collects metadata from GitHub Actions environment\n\n```go\ntype ArtifactStatusDetail struct {\n\tUUID      string `json:\"uuid\"`\n\tName      string `json:\"name\"`\n\tStatus    string `json:\"status\"`\n\tQueuePath string `json:\"queue_path,omitempty\"`\n\tError     string `json:\"error,omitempty\"`\n}\n```\nArtifactStatusDetail represents the status of an individual artifact\n\n```go\ntype ArtifactUploadResponse struct {\n\tUUID      string `json:\"uuid\"`\n\tQueuePath string `json:\"queue_path\"`\n\tSuccess   bool   `json:\"success\"`\n\tMessage   string `json:\"message,omitempty\"`\n}\n```\nArtifactUploadResponse represents the response from artifact upload\n\n```go\ntype ArtifactUploader struct {\n\t// contains filtered or unexported fields\n}\n```\nArtifactUploader handles uploading artifacts to Vulnetix API\n\n```go\nfunc NewArtifactUploader(baseURL, orgID string) *ArtifactUploader\n```\nNewArtifactUploader creates a new artifact uploader using centralized auth\n\n```go\nfunc (u *ArtifactUploader) GetArtifactStatus(artifactUUID string) (*StatusResponse, error)\n```\nGetArtifactStatus retrieves the status of a specific artifact by UUID\n\n```go\nfunc (u *ArtifactUploader) GetTransactionStatus(txnID string) (*StatusResponse, error)\n```\nGetTransactionStatus retrieves the status of a transaction\n\n```go\nfunc (u *ArtifactUploader) InitiateTransaction(metadata *ArtifactMetadata, artifactNames []string) (*TransactionResponse, error)\n```\nInitiateTransaction initiates a new artifact upload transaction\n\n```go\nfunc (u *ArtifactUploader) UploadArtifact(txnID, artifactName, artifactDir string) (*ArtifactUploadResponse, error)\n```\nUploadArtifact uploads a single artifact file to the specified transaction\n\n```go\ntype ArtifactsResponse struct {\n\tTotalCount int        `json:\"total_count\"`\n\tArtifacts  []Artifact `json:\"artifacts\"`\n}\n```\nArtifactsResponse represents the GitHub API response for artifacts\n\n```go\ntype StatusResponse struct {\n\tStatus    string                 `json:\"status\"`\n\tTxnID     string                 `json:\"txnid,omitempty\"`\n\tArtifacts []ArtifactStatusDetail `json:\"artifacts,omitempty\"`\n\tMessage   string                 `json:\"message,omitempty\"`\n\tDetails   map[string]interface{} `json:\"details,omitempty\"`\n}\n```\nStatusResponse represents the status check response\n\n```go\ntype TransactionRequest struct {\n\tMeta      *ArtifactMetadata `json:\"_meta\"`\n\tArtifacts []string          `json:\"artifacts\"`\n}\n```\nTransactionRequest represents the initial transaction creation request\n\n```go\ntype TransactionResponse struct {\n\tTxnID   string `json:\"txnid\"`\n\tSuccess bool   `json:\"success\"`\n\tMessage string `json:\"message,omitempty\"`\n}\n```\nTransactionResponse represents the response from transaction creation\n\n","path":"github.com/vulnetix/cli/internal/github","name":"github","synopsis":"","isRedistributable":true}
