cloudsmith

package
v0.0.85 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MPL-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package cloudsmith implements a Terraform provider for interacting with Cloudsmith.

Package cloudsmith provides Terraform provider functionality for managing Cloudsmith resources.

Index

Constants

View Source
const (
	DefaultPageSize   int64 = 100
	DefaultMaxResults int64 = 100 * DefaultPageSize
)
View Source
const (
	CreatedAt             string = "created_at"
	Description           string = "description"
	Name                  string = "name"
	AllowUnknownLicenses  string = "allow_unknown_licenses"
	OnViolationQuarantine string = "on_violation_quarantine"
	SlugPerm              string = "slug_perm"
	SpdxIdentifiers       string = "spdx_identifiers"
	PackageQueryString    string = "package_query_string"
	UpdatedAt             string = "updated_at"
	Organization          string = "organization"
)
View Source
const (
	Alpine      = "alpine"
	Cargo       = "cargo"
	Composer    = "composer"
	Conda       = "conda"
	Cran        = "cran"
	Dart        = "dart"
	Deb         = "deb"
	Docker      = "docker"
	Generic     = "generic"
	Go          = "go"
	Helm        = "helm"
	Hex         = "hex"
	HuggingFace = "huggingface"
	Maven       = "maven"
	Nix         = "nix"
	Npm         = "npm"
	NuGet       = "nuget"
	Python      = "python"
	Rpm         = "rpm"
	Ruby        = "ruby"
	Swift       = "swift"
)

upstream types

View Source
const (
	AuthMode             = "auth_mode"
	AuthSecret           = "auth_secret"
	AuthUsername         = "auth_username"
	Component            = "component"
	DistroVersion        = "distro_version"
	DistroVersions       = "distro_versions"
	ExtraHeader1         = "extra_header_1"
	ExtraHeader2         = "extra_header_2"
	ExtraValue1          = "extra_value_1"
	ExtraValue2          = "extra_value_2"
	IsActive             = "is_active"
	IncludeSources       = "include_sources"
	Mode                 = "mode"
	Priority             = "priority"
	TrustLevel           = "trust_level"
	UpstreamDistribution = "upstream_distribution"
	UpstreamPrefix       = "upstream_prefix"
	UpstreamType         = "upstream_type"
	UpstreamUrl          = "upstream_url"
	VerifySsl            = "verify_ssl"
	AuthCertificateKey   = "auth_certificate_key"
	AuthCertificate      = "auth_certificate"
)

tf state prop names

View Source
const (
	MinSeverity          string = "min_severity"
	AllowUnknownSeverity string = "allow_unknown_severity"
)
View Source
const CidrAllow string = "cidr_allow"
View Source
const CidrDeny string = "cidr_deny"
View Source
const CountryCodeAllow string = "country_code_allow"
View Source
const CountryCodeDeny string = "country_code_deny"
View Source
const Namespace string = "namespace"
View Source
const Repository string = "repository"
View Source
const (
	TargetRepository = "target_repository"
)

Variables

This section is empty.

Functions

func PaginateAll added in v0.0.75

func PaginateAll[T any](fetch PageFetcher[T], opts PaginationOptions) ([]T, error)

PaginateAll collects every page reported by the API, stopping early only when MaxResults is reached. Iteration ends when the current page equals the API-reported total page count (X-Pagination-PageTotal).

func PaginateAllHTTP added in v0.0.75

func PaginateAllHTTP[T any](exec PageExecutor[T], opts PaginationOptions) ([]T, error)

PaginateAllHTTP validates Cloudsmith pagination headers before paginating. A 404 response is treated as an empty list so callers can short-circuit "not found" without hitting header-parsing errors.

func Provider

func Provider() *schema.Provider

Provider returns a terraform.ResourceProvider.

Types

type Checksums added in v0.0.31

type Checksums struct {
	MD5    string
	SHA1   string
	SHA256 string
	SHA512 string
}

func (Checksums) CompareWithPkg added in v0.0.31

func (c Checksums) CompareWithPkg(pkg *cloudsmithapi.PackageDetail) error

type PageExecutor added in v0.0.75

type PageExecutor[T any] func(page, pageSize int64) (results []T, resp *http.Response, err error)

PageExecutor matches the generated SDK's list Execute methods.

type PageFetcher added in v0.0.75

type PageFetcher[T any] func(page, pageSize int64) (results []T, totalPages int64, err error)

PageFetcher fetches one page and returns the API-reported total page count.

type PaginationOptions added in v0.0.75

type PaginationOptions struct {
	PageSize   int64
	MaxResults int64
}

PaginationOptions controls page size and optional result cap.

type Upstream added in v0.0.26

type Upstream interface {
	GetAuthMode() string
	GetAuthSecret() string
	GetAuthUsername() string
	GetExtraHeader1() string
	GetExtraHeader2() string
	GetExtraValue1() string
	GetExtraValue2() string
	GetDisableReason() string
	GetDisableReasonText() string
	GetCreatedAt() time.Time
	GetIsActive() bool
	GetMode() string
	GetName() string
	GetPriority() int64
	GetSlugPerm() string
	GetUpdatedAt() time.Time
	GetUpstreamUrl() string
	GetVerifySsl() bool
}

Jump to

Keyboard shortcuts

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