Documentation
¶
Index ¶
- Constants
- type Artifact
- type Client
- func (c *Client) DownloadArtifact(artifactID string) ([]byte, error)
- func (c *Client) ListArtifacts(req *ListArtifactsRequest) (*ListArtifactsResponse, error)
- func (c *Client) UploadArtifact(req *UploadArtifactRequest) (*UploadArtifactResponse, error)
- func (c *Client) UploadFile(fleetID, filePath, scanType string, tags []string) (*UploadArtifactResponse, error)
- type ListArtifactsRequest
- type ListArtifactsResponse
- type UploadArtifactRequest
- type UploadArtifactResponse
Constants ¶
View Source
const ( // DefaultAPIURL is the default CloudShip API endpoint DefaultAPIURL = "https://staging.cloudshipai.com/api/v1" // MaxFileSize is the maximum file size for artifacts (100MB) MaxFileSize = 100 * 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
ID string `json:"id"`
FileName string `json:"file_name"`
FileType string `json:"file_type"`
FileSize int64 `json:"file_size"`
Version int `json:"version"`
CreatedAt time.Time `json:"created_at"`
Metadata map[string]interface{} `json:"metadata"`
}
Artifact represents an artifact in the list
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a CloudShip API client
func (*Client) DownloadArtifact ¶
DownloadArtifact downloads an artifact by ID
func (*Client) ListArtifacts ¶
func (c *Client) ListArtifacts(req *ListArtifactsRequest) (*ListArtifactsResponse, error)
ListArtifacts lists artifacts for a fleet
func (*Client) UploadArtifact ¶
func (c *Client) UploadArtifact(req *UploadArtifactRequest) (*UploadArtifactResponse, error)
UploadArtifact uploads an artifact to CloudShip
func (*Client) UploadFile ¶
func (c *Client) UploadFile(fleetID, filePath, scanType string, tags []string) (*UploadArtifactResponse, error)
UploadFile uploads a file as an artifact
type ListArtifactsRequest ¶
ListArtifactsRequest represents the request to list artifacts
type ListArtifactsResponse ¶
type ListArtifactsResponse struct {
Artifacts []Artifact `json:"artifacts"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
ListArtifactsResponse represents the response from listing artifacts
type UploadArtifactRequest ¶
type UploadArtifactRequest struct {
FleetID string `json:"fleet_id"`
FileName string `json:"file_name"`
FileType string `json:"file_type"`
Content string `json:"content"` // base64 encoded
Metadata map[string]interface{} `json:"metadata"`
}
UploadArtifactRequest represents the request to upload an artifact
Click to show internal directories.
Click to hide internal directories.