cloudsmith

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int
	Body       []byte
}

func (*APIError) Error

func (e *APIError) Error() string

type Client

type Client struct {
	APIKey string

	BaseURL string
	// contains filtered or unexported fields
}

Client is a thin wrapper around the Cloudsmith v1 HTTP API.

func NewClient

func NewClient(http core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) GetPackage

func (c *Client) GetPackage(owner, repo, identifier string) (*Package, error)

GetPackage fetches a single package identified by namespace, repository slug, and package identifier.

func (*Client) GetRepository

func (c *Client) GetRepository(owner, identifier string) (*Repository, error)

GetRepository fetches a single repository identified by namespace (owner) and slug.

func (*Client) GetSelf

func (c *Client) GetSelf() (*User, error)

GetSelf validates the API key by fetching the authenticated user.

func (*Client) ListPackages

func (c *Client) ListPackages(owner, repo string) ([]Package, error)

ListPackages returns all packages in the given repository, following pagination.

func (*Client) ListRepositories

func (c *Client) ListRepositories() ([]Repository, error)

ListRepositories returns every repository the authenticated user can access, following all pages until the API returns a page smaller than repositoryPageSize.

type Cloudsmith

type Cloudsmith struct{}

func (*Cloudsmith) Actions

func (c *Cloudsmith) Actions() []core.Action

func (*Cloudsmith) Cleanup

func (*Cloudsmith) Configuration

func (c *Cloudsmith) Configuration() []configuration.Field

func (*Cloudsmith) Description

func (c *Cloudsmith) Description() string

func (*Cloudsmith) HandleHook

func (c *Cloudsmith) HandleHook(ctx core.IntegrationHookContext) error

func (*Cloudsmith) HandleRequest

func (c *Cloudsmith) HandleRequest(ctx core.HTTPRequestContext)

func (*Cloudsmith) Hooks

func (c *Cloudsmith) Hooks() []core.Hook

func (*Cloudsmith) Icon

func (c *Cloudsmith) Icon() string

func (*Cloudsmith) Instructions

func (c *Cloudsmith) Instructions() string

func (*Cloudsmith) Label

func (c *Cloudsmith) Label() string

func (*Cloudsmith) ListResources

func (c *Cloudsmith) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*Cloudsmith) Name

func (c *Cloudsmith) Name() string

func (*Cloudsmith) Sync

func (c *Cloudsmith) Sync(ctx core.SyncContext) error

func (*Cloudsmith) Triggers

func (c *Cloudsmith) Triggers() []core.Trigger

type Configuration

type Configuration struct {
	APIKey string `json:"apiKey"`
}

type GetPackage

type GetPackage struct{}

func (*GetPackage) Cancel

func (g *GetPackage) Cancel(ctx core.ExecutionContext) error

func (*GetPackage) Cleanup

func (g *GetPackage) Cleanup(ctx core.SetupContext) error

func (*GetPackage) Color

func (g *GetPackage) Color() string

func (*GetPackage) Configuration

func (g *GetPackage) Configuration() []configuration.Field

func (*GetPackage) Description

func (g *GetPackage) Description() string

func (*GetPackage) Documentation

func (g *GetPackage) Documentation() string

func (*GetPackage) ExampleOutput

func (g *GetPackage) ExampleOutput() map[string]any

func (*GetPackage) Execute

func (g *GetPackage) Execute(ctx core.ExecutionContext) error

func (*GetPackage) HandleHook

func (g *GetPackage) HandleHook(ctx core.ActionHookContext) error

func (*GetPackage) HandleWebhook

func (*GetPackage) Hooks

func (g *GetPackage) Hooks() []core.Hook

func (*GetPackage) Icon

func (g *GetPackage) Icon() string

func (*GetPackage) Label

func (g *GetPackage) Label() string

func (*GetPackage) Name

func (g *GetPackage) Name() string

func (*GetPackage) OutputChannels

func (g *GetPackage) OutputChannels(configuration any) []core.OutputChannel

func (*GetPackage) ProcessQueueItem

func (g *GetPackage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*GetPackage) Setup

func (g *GetPackage) Setup(ctx core.SetupContext) error

type GetPackageSpec

type GetPackageSpec struct {
	Repository string `json:"repository" mapstructure:"repository"`
	Package    string `json:"package" mapstructure:"package"`
}

type GetRepository

type GetRepository struct{}

func (*GetRepository) Cancel

func (g *GetRepository) Cancel(ctx core.ExecutionContext) error

func (*GetRepository) Cleanup

func (g *GetRepository) Cleanup(ctx core.SetupContext) error

func (*GetRepository) Color

func (g *GetRepository) Color() string

func (*GetRepository) Configuration

func (g *GetRepository) Configuration() []configuration.Field

func (*GetRepository) Description

func (g *GetRepository) Description() string

func (*GetRepository) Documentation

func (g *GetRepository) Documentation() string

func (*GetRepository) ExampleOutput

func (g *GetRepository) ExampleOutput() map[string]any

func (*GetRepository) Execute

func (g *GetRepository) Execute(ctx core.ExecutionContext) error

func (*GetRepository) HandleHook

func (g *GetRepository) HandleHook(ctx core.ActionHookContext) error

func (*GetRepository) HandleWebhook

func (*GetRepository) Hooks

func (g *GetRepository) Hooks() []core.Hook

func (*GetRepository) Icon

func (g *GetRepository) Icon() string

func (*GetRepository) Label

func (g *GetRepository) Label() string

func (*GetRepository) Name

func (g *GetRepository) Name() string

func (*GetRepository) OutputChannels

func (g *GetRepository) OutputChannels(configuration any) []core.OutputChannel

func (*GetRepository) ProcessQueueItem

func (g *GetRepository) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*GetRepository) Setup

func (g *GetRepository) Setup(ctx core.SetupContext) error

type GetRepositorySpec

type GetRepositorySpec struct {
	Repository string `json:"repository" mapstructure:"repository"`
}

type Metadata

type Metadata struct {
	UserSlug  string `json:"userSlug"`
	UserName  string `json:"userName"`
	UserEmail string `json:"userEmail"`
}

type Package

type Package struct {
	// Identity
	Slug        string `json:"slug"`
	SlugPerm    string `json:"slug_perm"`
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	Version     string `json:"version"`
	Filename    string `json:"filename"`
	Format      string `json:"format"`
	Repository  string `json:"repository"`
	Namespace   string `json:"namespace"`
	UploadedAt  string `json:"uploaded_at"`
	Uploader    string `json:"uploader"`

	// Status
	Status          int    `json:"status"`
	StatusStr       string `json:"status_str"`
	StatusReason    string `json:"status_reason"`
	StatusUpdatedAt string `json:"status_updated_at"`

	// Stage / sync
	Stage            int    `json:"stage"`
	StageStr         string `json:"stage_str"`
	StageUpdatedAt   string `json:"stage_updated_at"`
	IsSyncAwaiting   bool   `json:"is_sync_awaiting"`
	IsSyncCompleted  bool   `json:"is_sync_completed"`
	IsSyncFailed     bool   `json:"is_sync_failed"`
	IsSyncInFlight   bool   `json:"is_sync_in_flight"`
	IsSyncInProgress bool   `json:"is_sync_in_progress"`
	SyncFinishedAt   string `json:"sync_finished_at"`
	SyncProgress     int    `json:"sync_progress"`

	// Quarantine / policy
	IsQuarantined  bool `json:"is_quarantined"`
	PolicyViolated bool `json:"policy_violated"`

	// Security scanning
	SecurityScanStatus      string `json:"security_scan_status"`
	SecurityScanStartedAt   string `json:"security_scan_started_at"`
	SecurityScanCompletedAt string `json:"security_scan_completed_at"`
	VulnerabilityResultsURL string `json:"vulnerability_scan_results_url"`

	// Checksums
	ChecksumMD5    string `json:"checksum_md5"`
	ChecksumSHA1   string `json:"checksum_sha1"`
	ChecksumSHA256 string `json:"checksum_sha256"`
	ChecksumSHA512 string `json:"checksum_sha512"`

	// URLs
	SelfURL       string `json:"self_url"`
	SelfHTMLURL   string `json:"self_html_url"`
	SelfWebappURL string `json:"self_webapp_url"`
	CDNURL        string `json:"cdn_url"`

	// Size / metadata
	Size        int64  `json:"size"`
	SizeStr     string `json:"size_str"`
	Description string `json:"description"`
	Summary     string `json:"summary"`

	// Tags
	Tags          map[string]any `json:"tags"`
	TagsImmutable map[string]any `json:"tags_immutable"`
}

Package represents a Cloudsmith package with its metadata.

type PackageNodeMetadata

type PackageNodeMetadata struct {
	RepositoryID        string `json:"repositoryId" mapstructure:"repositoryId"`
	RepositoryName      string `json:"repositoryName" mapstructure:"repositoryName"`
	RepositoryNamespace string `json:"repositoryNamespace" mapstructure:"repositoryNamespace"`
	RepositorySlug      string `json:"repositorySlug" mapstructure:"repositorySlug"`
	PackageID           string `json:"packageId" mapstructure:"packageId"`
	PackageName         string `json:"packageName" mapstructure:"packageName"`
}

PackageNodeMetadata caches both the repository and package display names so the UI can show human-readable labels without extra API calls.

type Repository

type Repository struct {
	Name                      string `json:"name"`
	Slug                      string `json:"slug"`
	SlugPerm                  string `json:"slug_perm"`
	Namespace                 string `json:"namespace"`
	NamespaceURL              string `json:"namespace_url"`
	Description               string `json:"description"`
	RepositoryType            string `json:"repository_type_str"`
	ContentKind               string `json:"content_kind"`
	StorageRegion             string `json:"storage_region"`
	CDNUrl                    string `json:"cdn_url"`
	SelfURL                   string `json:"self_url"`
	SelfHTMLUrl               string `json:"self_html_url"`
	SelfWebappURL             string `json:"self_webapp_url"`
	IsPrivate                 bool   `json:"is_private"`
	IsPublic                  bool   `json:"is_public"`
	IsOpenSource              bool   `json:"is_open_source"`
	Size                      int64  `json:"size"`
	SizeStr                   string `json:"size_str"`
	PackageCount              int64  `json:"package_count"`
	PackageGroupCount         int64  `json:"package_group_count"`
	NumDownloads              int64  `json:"num_downloads"`
	NumQuarantinedPackages    int64  `json:"num_quarantined_packages"`
	NumPolicyViolatedPackages int64  `json:"num_policy_violated_packages"`
	CreatedAt                 string `json:"created_at"`
}

Repository holds the Cloudsmith repository fields most useful for workflows.

type RepositoryNodeMetadata

type RepositoryNodeMetadata struct {
	RepositoryID        string `json:"repositoryId" mapstructure:"repositoryId"`
	RepositoryName      string `json:"repositoryName" mapstructure:"repositoryName"`
	RepositoryNamespace string `json:"repositoryNamespace" mapstructure:"repositoryNamespace"`
	RepositorySlug      string `json:"repositorySlug" mapstructure:"repositorySlug"`
}

RepositoryNodeMetadata caches the human-readable repository name so the UI can display it without re-fetching from the API on every render.

type User

type User struct {
	Authenticated bool   `json:"authenticated"`
	Email         string `json:"email"`
	Name          string `json:"name"`
	Slug          string `json:"slug"`
}

Jump to

Keyboard shortcuts

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