cloudship

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 NewClient

func NewClient(apiKey string) *Client

NewClient creates a new CloudShip API client

func (*Client) DownloadArtifact

func (c *Client) DownloadArtifact(artifactID string) ([]byte, error)

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

type ListArtifactsRequest struct {
	FleetID string
	Limit   int
	Offset  int
	Type    string
}

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

type UploadArtifactResponse

type UploadArtifactResponse struct {
	ArtifactID  string    `json:"artifact_id"`
	DownloadURL string    `json:"download_url"`
	Version     int       `json:"version"`
	CreatedAt   time.Time `json:"created_at"`
}

UploadArtifactResponse represents the response from uploading an artifact

Jump to

Keyboard shortcuts

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