Documentation
¶
Index ¶
- type APIError
- type Client
- func (c *Client) GetPackage(owner, repo, identifier string) (*Package, error)
- func (c *Client) GetRepository(owner, identifier string) (*Repository, error)
- func (c *Client) GetSelf() (*User, error)
- func (c *Client) ListPackages(owner, repo string) ([]Package, error)
- func (c *Client) ListRepositories() ([]Repository, error)
- type Cloudsmith
- func (c *Cloudsmith) Actions() []core.Action
- func (c *Cloudsmith) Cleanup(ctx core.IntegrationCleanupContext) error
- func (c *Cloudsmith) Configuration() []configuration.Field
- func (c *Cloudsmith) Description() string
- func (c *Cloudsmith) HandleHook(ctx core.IntegrationHookContext) error
- func (c *Cloudsmith) HandleRequest(ctx core.HTTPRequestContext)
- func (c *Cloudsmith) Hooks() []core.Hook
- func (c *Cloudsmith) Icon() string
- func (c *Cloudsmith) Instructions() string
- func (c *Cloudsmith) Label() string
- func (c *Cloudsmith) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (c *Cloudsmith) Name() string
- func (c *Cloudsmith) Sync(ctx core.SyncContext) error
- func (c *Cloudsmith) Triggers() []core.Trigger
- type Configuration
- type GetPackage
- func (g *GetPackage) Cancel(ctx core.ExecutionContext) error
- func (g *GetPackage) Cleanup(ctx core.SetupContext) error
- func (g *GetPackage) Color() string
- func (g *GetPackage) Configuration() []configuration.Field
- func (g *GetPackage) Description() string
- func (g *GetPackage) Documentation() string
- func (g *GetPackage) ExampleOutput() map[string]any
- func (g *GetPackage) Execute(ctx core.ExecutionContext) error
- func (g *GetPackage) HandleHook(ctx core.ActionHookContext) error
- func (g *GetPackage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (g *GetPackage) Hooks() []core.Hook
- func (g *GetPackage) Icon() string
- func (g *GetPackage) Label() string
- func (g *GetPackage) Name() string
- func (g *GetPackage) OutputChannels(configuration any) []core.OutputChannel
- func (g *GetPackage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (g *GetPackage) Setup(ctx core.SetupContext) error
- type GetPackageSpec
- type GetRepository
- func (g *GetRepository) Cancel(ctx core.ExecutionContext) error
- func (g *GetRepository) Cleanup(ctx core.SetupContext) error
- func (g *GetRepository) Color() string
- func (g *GetRepository) Configuration() []configuration.Field
- func (g *GetRepository) Description() string
- func (g *GetRepository) Documentation() string
- func (g *GetRepository) ExampleOutput() map[string]any
- func (g *GetRepository) Execute(ctx core.ExecutionContext) error
- func (g *GetRepository) HandleHook(ctx core.ActionHookContext) error
- func (g *GetRepository) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (g *GetRepository) Hooks() []core.Hook
- func (g *GetRepository) Icon() string
- func (g *GetRepository) Label() string
- func (g *GetRepository) Name() string
- func (g *GetRepository) OutputChannels(configuration any) []core.OutputChannel
- func (g *GetRepository) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (g *GetRepository) Setup(ctx core.SetupContext) error
- type GetRepositorySpec
- type Metadata
- type Package
- type PackageNodeMetadata
- type Repository
- type RepositoryNodeMetadata
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
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 ¶
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) ListPackages ¶
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 (c *Cloudsmith) Cleanup(ctx core.IntegrationCleanupContext) error
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 (g *GetPackage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
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 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 (g *GetRepository) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
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 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.