Documentation
¶
Overview ¶
Package repo is the repository configuration model: the JSON document that PUT, POST and GET /artifactory/api/repositories/{key} exchange, with JFrog's field names. It is a wire model, so its JSON tags follow Artifactory's camelCase rather than the repository's snake_case rule; .golangci.yml excludes this package from tagliatelle for that reason. Field semantics, defaults and per-class rules are documented in docs/research/03-repository-configuration-model.md.
Index ¶
- Constants
- Variables
- func AcceptsMember(virtual, member PackageType) bool
- func DefaultLayout(packageType PackageType, terraformType TerraformType) string
- func PackageTypeDisplayName(packageType string) string
- func PackageTypeName(packageType string) string
- func RestoreSecrets(stored Config, updated *Config)
- func Validate(c *Config) error
- func ValidateKeyPair(c *Config, field, name, pairType string) error
- func ValidateStored(c *Config) error
- func ValidateUpdate(stored, updated *Config) error
- type ChecksumPolicy
- type Class
- type Config
- type ContentSyncSource
- type ContentSynchronisation
- type CreationOnlyError
- type CustomHTTPHeader
- type DockerAPIVersion
- type EnabledFlag
- type FieldError
- type FlexBool
- type Member
- type PackageType
- type PomCleanupPolicy
- type RemoteChecksumPolicy
- type SnapshotVersionBehavior
- type TerraformType
- type VCSGitProvider
- type ValidationError
Constants ¶
const ( DefaultIncludesPattern = "**/*" DefaultRetrievalCachePeriodSecs = 7200 DefaultDockerRetrievalCachePeriodSecs = 21600 DefaultMissedRetrievalCachePeriodSecs = 1800 DefaultGoMissedRetrievalCachePeriod = 600 DefaultSocketTimeoutMillis = 15000 DefaultAssumedOfflinePeriodSecs = 300 DefaultMetadataRetrievalTimeoutSecs = 60 DefaultDockerTagRetention = 1 DefaultVirtualRetrievalCachePeriod = 7200 DefaultPyPIRegistryURL = "https://pypi.org" DefaultPyPIRepositorySuffix = "simple" DefaultFeedContextPath = "api/v2" DefaultDownloadContextPath = "api/v2/package" DefaultV3FeedURL = "https://api.nuget.org/v3/index.json" DefaultVCSType = "GIT" DefaultBowerRegistryURL = "https://registry.bower.io" DefaultCargoGitRegistryURL = "https://github.com/rust-lang/crates.io-index" DefaultComposerRegistryURL = "https://packagist.org" DefaultTerraformRegistryURL = "https://registry.terraform.io" DefaultTerraformProvidersURL = "https://releases.hashicorp.com" DefaultNIMModelURL = "https://api.ngc.nvidia.com" )
Default values documented for repository configuration fields. Each one must match docs/research/03-repository-configuration-model.md, which cites JFrog's configuration-json-files page; the Terraform providers compare the values they read back against these.
const ( MinRetrievalCachePeriodSecs = 30 MinChocolateyRetrievalCachePeriodSecs = 14400 )
Minimums of a remote repository's retrievalCachePeriodSecs. JFrog's remote repositories page gives 30 seconds for most remote repositories and 14,400 for a NuGet remote that proxies community.chocolatey.org; SaaS 7.144.2's notice exempts smart remote repositories from the 30.
const ( LayoutMaven2 = "maven-2-default" LayoutMaven1 = "maven-1-default" LayoutIvy = "ivy-default" LayoutGradle = "gradle-default" LayoutSBT = "sbt-default" LayoutSBTIvy = "sbt-ivy-default" LayoutSimple = "simple-default" LayoutNPM = "npm-default" LayoutNuGet = "nuget-default" LayoutGo = "go-default" LayoutTerraformModule = "terraform-module-default" LayoutTerraformProvider = "terraform-provider-default" LayoutCargo = "cargo-default" LayoutBower = "bower-default" LayoutComposer = "composer-default" LayoutConan = "conan-default" LayoutPuppet = "puppet-default" LayoutAnsible = "ansible-default" LayoutSwift = "swift-default" LayoutNix = "nix-default" LayoutBuild = "build-default" )
Layout identifiers bundled with Artifactory.
Variables ¶
var ErrInvalid = errors.New("invalid repository configuration")
ErrInvalid is the sentinel every validation failure wraps.
var ErrNotBoolean = errors.New("value is not a boolean")
ErrNotBoolean reports a flexible boolean that is neither a JSON boolean nor the strings "true" or "false".
Functions ¶
func AcceptsMember ¶
func AcceptsMember(virtual, member PackageType) bool
AcceptsMember reports whether a virtual repository of package type virtual may list a member of package type member. A generic virtual repository aggregates any type; the Maven family shares one metadata format, so its types mix; every other type takes only its own.
func DefaultLayout ¶
func DefaultLayout(packageType PackageType, terraformType TerraformType) string
DefaultLayout returns the repoLayoutRef the JFrog Terraform provider assigns to a package type when the caller sets none (its default_repo_layout_map). The REST API gives a create without one createLayout's layout instead, which differs for most types. Nothing in artifactweave calls this outside the tests; it is exported for importers of pkg/repo that want the ecosystem-appropriate layout.
func PackageTypeDisplayName ¶
PackageTypeDisplayName returns the spelling of packageType that Artifactory 7.x's storage summary (GET /api/storageinfo) shows, such as "Generic", "npm" or "RPM". jfrog-cli-core's transfer-files compares it with "Maven", "Gradle", "Ivy", "Docker", "Conan", "NuGet" and "SBT" to order uploads. The lookup ignores case, and a type with no display name of its own is spelled as PackageTypeName spells it.
func PackageTypeName ¶
PackageTypeName returns the spelling of packageType that Artifactory 7.x listings show, such as "Generic", "Npm" or "YUM" for rpm. The lookup ignores case. A type with no entry gets its first letter capitalised, which is how most enumeration names are formed, and an empty type stays empty.
func RestoreSecrets ¶
RestoreSecrets copies stored sensitive header values into updated where updated carries the same header back with the empty value Masked gave it, so a client that reads a configuration and writes it back does not wipe its secrets.
func Validate ¶
Validate checks the rules a create or full update must satisfy. It returns nil or a ValidationError list; it does not apply defaults, so run Defaults first when validating a document that relies on them.
func ValidateKeyPair ¶
ValidateKeyPair checks that a key pair a repository's field (primaryKeyPairRef or secondaryKeyPairRef) names, called name, of type pairType, is one the repository can use. Alpine indexes require RSA; Debian Release metadata and local or federated Terraform PROVIDER repositories require GPG signing keys.
func ValidateStored ¶
ValidateStored is Validate for an update, which keeps the stored key: it skips the key rules, which that key met when a client created it or which the server set aside when it created the repository under a name they reserve. The server's build-info repository also keeps its package type, buildinfo, which no class allows a client to choose.
func ValidateUpdate ¶
ValidateUpdate checks updated, the configuration an update of stored leaves once merged, defaulted and validated, against the fields of stored's package type that only a create may set: a CreationOnlyError names the first one it changes. An update that leaves such a field out, repeats its stored value, or sets one the repository was created without where the field allows it, passes.
Types ¶
type ChecksumPolicy ¶
type ChecksumPolicy string
ChecksumPolicy governs client-supplied checksums on local repositories.
const ( ClientChecksums ChecksumPolicy = "client-checksums" ServerGeneratedChecksums ChecksumPolicy = "server-generated-checksums" )
Checksum policies.
type Config ¶
type Config struct {
// Common
Key string `json:"key"`
Class Class `json:"rclass"`
PackageType PackageType `json:"packageType,omitempty"`
ProjectKey string `json:"projectKey,omitempty"`
Environments []string `json:"environments,omitempty"`
Description string `json:"description"`
Notes string `json:"notes"`
IncludesPattern *string `json:"includesPattern,omitempty"`
ExcludesPattern *string `json:"excludesPattern,omitempty"`
RepoLayoutRef string `json:"repoLayoutRef,omitempty"`
BlackedOut *bool `json:"blackedOut,omitempty"`
XrayIndex *bool `json:"xrayIndex,omitempty"`
PropertySets []string `json:"propertySets,omitempty"`
PriorityResolution *FlexBool `json:"priorityResolution,omitempty"`
DownloadRedirect *FlexBool `json:"downloadRedirect,omitempty"`
CDNRedirect *FlexBool `json:"cdnRedirect,omitempty"`
PrimaryKeyPairRef string `json:"primaryKeyPairRef,omitempty"`
SecondaryKeyPairRef string `json:"secondaryKeyPairRef,omitempty"`
SignedURLTTL *int `json:"signedUrlTtl,omitempty"`
XrayDataTTL *int `json:"xrayDataTtl,omitempty"`
// Local and federated
ChecksumPolicyType ChecksumPolicy `json:"checksumPolicyType,omitempty"`
HandleReleases *bool `json:"handleReleases,omitempty"`
HandleSnapshots *bool `json:"handleSnapshots,omitempty"`
MaxUniqueSnapshots *int `json:"maxUniqueSnapshots,omitempty"`
SnapshotVersionBehavior SnapshotVersionBehavior `json:"snapshotVersionBehavior,omitempty"`
SuppressPomConsistencyChecks *bool `json:"suppressPomConsistencyChecks,omitempty"`
MaxUniqueTags *int `json:"maxUniqueTags,omitempty"`
DockerTagRetention *int `json:"dockerTagRetention,omitempty"`
DockerAPIVersion DockerAPIVersion `json:"dockerApiVersion,omitempty"`
BlockPushingSchema1 *FlexBool `json:"blockPushingSchema1,omitempty"`
ArchiveBrowsingEnabled *bool `json:"archiveBrowsingEnabled,omitempty"`
EnableFileListsIndexing *FlexBool `json:"enableFileListsIndexing,omitempty"`
OptionalIndexCompressionFormats []string `json:"optionalIndexCompressionFormats,omitempty"`
DebianTrivialLayout *bool `json:"debianTrivialLayout,omitempty"`
DdebSupported *bool `json:"ddebSupported,omitempty"`
CalculateYumMetadata *bool `json:"calculateYumMetadata,omitempty"`
YumRootDepth *int `json:"yumRootDepth,omitempty"`
YumGroupFileNames string `json:"yumGroupFileNames,omitempty"`
TerraformType TerraformType `json:"terraformType,omitempty"`
EncryptStates *bool `json:"encryptStates,omitempty"`
ForceNugetAuthentication *bool `json:"forceNugetAuthentication,omitempty"`
ForceP2Authentication *bool `json:"forceP2Authentication,omitempty"`
ForceConanAuthentication *bool `json:"forceConanAuthentication,omitempty"`
ForceMetadataNameVersion *bool `json:"forceMetadataNameVersion,omitempty"`
ForceNonDuplicateChart *bool `json:"forceNonDuplicateChart,omitempty"`
EnableConanSupport *bool `json:"enableConanSupport,omitempty"`
Members []Member `json:"members,omitempty"`
// Cargo, local and remote
CargoAnonymousAccess *bool `json:"cargoAnonymousAccess,omitempty"`
CargoInternalIndex *bool `json:"cargoInternalIndex,omitempty"`
// Remote
URL string `json:"url,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Proxy string `json:"proxy,omitempty"`
DisableProxy *bool `json:"disableProxy,omitempty"`
RemoteRepoLayoutRef string `json:"remoteRepoLayoutRef,omitempty"`
RemoteRepoChecksumPolicyType RemoteChecksumPolicy `json:"remoteRepoChecksumPolicyType,omitempty"`
HardFail *bool `json:"hardFail,omitempty"`
Offline *bool `json:"offline,omitempty"`
StoreArtifactsLocally *bool `json:"storeArtifactsLocally,omitempty"`
SocketTimeoutMillis *int `json:"socketTimeoutMillis,omitempty"`
LocalAddress string `json:"localAddress,omitempty"`
RetrievalCachePeriodSecs *int `json:"retrievalCachePeriodSecs,omitempty"`
MissedRetrievalCachePeriodSecs *int `json:"missedRetrievalCachePeriodSecs,omitempty"`
MetadataRetrievalTimeoutSecs *int `json:"metadataRetrievalTimeoutSecs,omitempty"`
AssumedOfflinePeriodSecs *int `json:"assumedOfflinePeriodSecs,omitempty"`
UnusedArtifactsCleanupPeriodHours *int `json:"unusedArtifactsCleanupPeriodHours,omitempty"`
FetchJarsEagerly *bool `json:"fetchJarsEagerly,omitempty"`
FetchSourcesEagerly *bool `json:"fetchSourcesEagerly,omitempty"`
RejectInvalidJars *bool `json:"rejectInvalidJars,omitempty"`
SynchronizeProperties *bool `json:"synchronizeProperties,omitempty"`
BlockMismatchingMimeTypes *bool `json:"blockMismatchingMimeTypes,omitempty"`
MismatchingMimeTypesOverrideList string `json:"mismatchingMimeTypesOverrideList,omitempty"`
AllowAnyHostAuth *bool `json:"allowAnyHostAuth,omitempty"`
EnableCookieManagement *bool `json:"enableCookieManagement,omitempty"`
EnableTokenAuthentication *bool `json:"enableTokenAuthentication,omitempty"`
BypassHeadRequests *bool `json:"bypassHeadRequests,omitempty"`
ClientTLSCertificate string `json:"clientTlsCertificate,omitempty"`
ListRemoteFolderItems *FlexBool `json:"listRemoteFolderItems,omitempty"`
QueryParams string `json:"queryParams,omitempty"`
PropagateQueryParams *bool `json:"propagateQueryParams,omitempty"`
RetrieveSha256FromServer *bool `json:"retrieveSha256FromServer,omitempty"`
Curated *bool `json:"curated,omitempty"`
PassThrough *bool `json:"passThrough,omitempty"`
DisableURLNormalization *bool `json:"disableUrlNormalization,omitempty"`
CustomHTTPHeaders []CustomHTTPHeader `json:"customHttpHeaders,omitempty"`
ContentSynchronisation *ContentSynchronisation `json:"contentSynchronisation,omitempty"`
PyPIRegistryURL string `json:"pyPIRegistryUrl,omitempty"`
PyPIRepositorySuffix string `json:"pyPIRepositorySuffix,omitempty"`
FeedContextPath *string `json:"feedContextPath,omitempty"`
DownloadContextPath *string `json:"downloadContextPath,omitempty"`
V3FeedURL string `json:"v3FeedUrl,omitempty"`
SymbolServerURL string `json:"symbolServerUrl,omitempty"`
ChartsBaseURL string `json:"chartsBaseUrl,omitempty"`
TerraformRegistryURL string `json:"terraformRegistryUrl,omitempty"`
TerraformProvidersURL string `json:"terraformProvidersUrl,omitempty"`
VCSType string `json:"vcsType,omitempty"`
VCSGitProvider VCSGitProvider `json:"vcsGitProvider,omitempty"`
VCSGitDownloadURL string `json:"vcsGitDownloadUrl,omitempty"`
DockerProjectID string `json:"dockerProjectId,omitempty"`
BowerRegistryURL string `json:"bowerRegistryUrl,omitempty"`
GitRegistryURL string `json:"gitRegistryUrl,omitempty"`
ComposerRegistryURL string `json:"composerRegistryUrl,omitempty"`
PodsSpecsRepoURL string `json:"podsSpecsRepoUrl,omitempty"`
PodsCdnURL string `json:"podsCdnUrl,omitempty"`
// P2ChildOrigins explicitly admits origins named by remote composite sites.
// The repository URL's own origin is always admitted.
P2ChildOrigins []string `json:"p2ChildOrigins,omitempty"`
HexPublicKey string `json:"hexPublicKey,omitempty"`
// Shared by remote and virtual
ExternalDependenciesEnabled *bool `json:"externalDependenciesEnabled,omitempty"`
ExternalDependenciesPatterns []string `json:"externalDependenciesPatterns,omitempty"`
ExternalDependenciesRemoteRepo string `json:"externalDependenciesRemoteRepo,omitempty"`
// Virtual
Repositories []string `json:"repositories,omitempty"`
DefaultDeploymentRepo string `json:"defaultDeploymentRepo,omitempty"`
ArtifactoryRequestsCanRetrieveRemoteArtifacts *bool `json:"artifactoryRequestsCanRetrieveRemoteArtifacts,omitempty"`
VirtualRetrievalCachePeriodSecs *int `json:"virtualRetrievalCachePeriodSecs,omitempty"`
KeyPair string `json:"keyPair,omitempty"`
PomRepositoryReferencesCleanupPolicy PomCleanupPolicy `json:"pomRepositoryReferencesCleanupPolicy,omitempty"`
ForceMavenAuthentication *bool `json:"forceMavenAuthentication,omitempty"`
ResolveDockerTagsByTimestamp *bool `json:"resolveDockerTagsByTimestamp,omitempty"`
UseNamespaces *bool `json:"useNamespaces,omitempty"`
DebianDefaultArchitectures string `json:"debianDefaultArchitectures,omitempty"`
P2URLs []string `json:"p2Urls,omitempty"`
}
Config is the repository configuration document. Optional scalars are pointers so that "not supplied" is distinguishable from the zero value: an update is partial, and Defaults fills only what the caller left nil.
description and notes have no omitempty: every read, the non-admin view included, carries them as "" when unset, as Artifactory's reads do, and stored documents carry them too. The non-admin view (Public) always shows notes as "". An update encoded from a Config therefore sets both, so a caller that means to leave them alone sends its own JSON without them.
func Defaults ¶
Defaults fills every field the caller left unset with the value Artifactory would apply on create. It returns the config so it can be chained; the receiver is modified in place. Fields that belong to another class are left alone so a local repository does not grow remote-only keys.
func Masked ¶
Masked returns c without its secrets, for every reader: the remote password and the values of sensitive custom headers. An update that omits the password, or sends a sensitive header back with an empty value, keeps the stored secret (RestoreSecrets).
It also lists no environments as [] rather than leaving the key out, as Artifactory does: the Terraform provider defaults project_environments to an empty set and reads an absent key as null, so every plan would show a change. It lists no property sets as [] too, as Artifactory's configuration samples do, except on a virtual repository, whose configuration has no such field.
func Public ¶
Public returns the subset of c that a caller who can read the repository but is not an administrator receives: identity, layout and patterns, with nothing that configures access or holds a secret.
func Relevant ¶
Relevant returns c without the package-specific fields that do not apply to its package type, the shape GET /api/v2/repositories/{key} and each entry of GET /api/repositories/configurations return: a generic repository has no Maven or Docker fields, as JFrog's generic local samples of both show.
func (Config) MarshalJSON ¶
MarshalJSON writes environments, repositories and propertySets as [] when the slice is empty but not nil, which omitempty would drop: Masked relies on that for API responses, and a nil slice still leaves the key out. The outer fields shadow the embedded ones because encoding/json prefers the shallower field.
func (*Config) UnmarshalJSON ¶
UnmarshalJSON decodes a repository document. FlexBool already accepts both spellings, so this only exists because the generated API server wraps Config in response types that delegate both directions to it; without the method the wrapper does not compile.
type ContentSyncSource ¶
type ContentSyncSource struct {
OriginAbsenceDetection bool `json:"originAbsenceDetection"`
}
ContentSyncSource is the source section of contentSynchronisation.
type ContentSynchronisation ¶
type ContentSynchronisation struct {
Enabled bool `json:"enabled"`
Statistics *EnabledFlag `json:"statistics,omitempty"`
Properties *EnabledFlag `json:"properties,omitempty"`
Source *ContentSyncSource `json:"source,omitempty"`
}
ContentSynchronisation configures a smart remote repository.
type CreationOnlyError ¶
type CreationOnlyError struct {
Field string
PackageType PackageType
Once bool
}
CreationOnlyError is an update that changes a field its repository takes only when it is created, or, with Once, a field it may take once and then keep. It unwraps to ErrInvalid.
func (CreationOnlyError) Error ¶
func (e CreationOnlyError) Error() string
func (CreationOnlyError) Unwrap ¶
func (CreationOnlyError) Unwrap() error
Unwrap lets errors.Is(err, ErrInvalid) work.
type CustomHTTPHeader ¶
type CustomHTTPHeader struct {
Name string `json:"name"`
Value string `json:"value"`
Sensitive bool `json:"sensitive"`
}
CustomHTTPHeader is one entry of a remote repository's customHttpHeaders.
type DockerAPIVersion ¶
type DockerAPIVersion string
DockerAPIVersion is the Docker registry API version a repository speaks.
const ( DockerV1 DockerAPIVersion = "V1" DockerV2 DockerAPIVersion = "V2" )
Docker API versions. V1 is legacy and only accepted for compatibility.
type EnabledFlag ¶
type EnabledFlag struct {
Enabled bool `json:"enabled"`
}
EnabledFlag is a nested {"enabled": bool} object.
type FieldError ¶
FieldError reports one invalid field. Field is the JSON name so the error can be shown to API clients and Terraform users as they see the document.
func (FieldError) Error ¶
func (e FieldError) Error() string
type FlexBool ¶
type FlexBool struct {
Value bool
}
FlexBool is a boolean that JFrog documents inconsistently. JFrog's JSON documentation and OpenAPI schema declare enableFileListsIndexing, downloadRedirect, cdnRedirect, priorityResolution and blockPushingSchema1 as strings on local and federated repositories, federated members[].enabled as a string, and remote listRemoteFolderItems as the string "false" (docs/research/03-repository-configuration-model.md, "Typing traps"). Artifactory itself sends JSON booleans: the JFrog Terraform provider 12.11.14 decodes all seven into Go bools on every class and fails its refresh on a quoted value, and its sample local repository shows "cdnRedirect": false. So the server writes booleans and accepts both spellings on input, for clients that followed the documentation.
func (FlexBool) MarshalJSON ¶
MarshalJSON writes a JSON boolean, never the documented string spelling.
func (*FlexBool) UnmarshalJSON ¶
UnmarshalJSON accepts true, false, "true" and "false". Anything else is an error rather than a silent false, because a misspelt flag on a repository that controls redirects or indexing must not pass validation unnoticed.
type Member ¶
Member is one federated repository member. enabled is a FlexBool because JFrog documents it as a string; nil means the caller did not say, and Defaults turns that into true.
type PackageType ¶
type PackageType string
PackageType is the ecosystem a repository serves.
const ( Alpine PackageType = "alpine" Cargo PackageType = "cargo" Composer PackageType = "composer" Bower PackageType = "bower" Chef PackageType = "chef" CocoaPods PackageType = "cocoapods" Conan PackageType = "conan" Conda PackageType = "conda" Cran PackageType = "cran" Debian PackageType = "debian" Docker PackageType = "docker" Helm PackageType = "helm" HelmOCI PackageType = "helmoci" HuggingFaceML PackageType = "huggingfaceml" Gems PackageType = "gems" GitLFS PackageType = "gitlfs" Go PackageType = "go" Gradle PackageType = "gradle" Ivy PackageType = "ivy" Maven PackageType = "maven" NPM PackageType = "npm" NuGet PackageType = "nuget" OCI PackageType = "oci" Opkg PackageType = "opkg" Pub PackageType = "pub" Puppet PackageType = "puppet" PyPI PackageType = "pypi" RPM PackageType = "rpm" SBT PackageType = "sbt" Swift PackageType = "swift" Terraform PackageType = "terraform" TerraformBackend PackageType = "terraformbackend" Vagrant PackageType = "vagrant" Ansible PackageType = "ansible" BazelModules PackageType = "bazelmodules" Generic PackageType = "generic" VCS PackageType = "vcs" P2 PackageType = "p2" Hex PackageType = "hex" Nix PackageType = "nix" MachineLearning PackageType = "machinelearning" // AIEditorExtensions and JetBrainsPlugins proxy IDE marketplaces and // exist only for remote repositories. AIEditorExtensions PackageType = "aieditorextensions" JetBrainsPlugins PackageType = "jetbrainsplugins" LuaRocks PackageType = "luarocks" NIMModel PackageType = "nimmodel" Skills PackageType = "skills" AgentPlugins PackageType = "agentplugins" AgentPackages PackageType = "agentpackages" // ReleaseBundles is the type of the repositories that store release // bundles, local and federated only, as the Terraform provider's map // offers it. No package handler serves it yet. ReleaseBundles PackageType = "releasebundles" // BuildInfo is the type of the built-in artifactory-build-info // repository. It is in no AllowedPackageTypes list, so the repositories // API cannot create another; an update of that one repository keeps it // (ValidateStored). BuildInfo PackageType = "buildinfo" )
Package types, in the order JFrog's JSON documentation lists them, then the types that page does not list. VCS exists only for remote repositories, P2 for remote and virtual ones.
func AllowedPackageTypes ¶
func AllowedPackageTypes(class Class) []PackageType
AllowedPackageTypes returns the package types a repository of the given class may declare, or nil for an unknown class.
type PomCleanupPolicy ¶
type PomCleanupPolicy string
PomCleanupPolicy is the virtual repository POM repository-reference policy.
const ( DiscardActiveReference PomCleanupPolicy = "discard_active_reference" DiscardAnyReference PomCleanupPolicy = "discard_any_reference" Nothing PomCleanupPolicy = "nothing" )
POM cleanup policies.
type RemoteChecksumPolicy ¶
type RemoteChecksumPolicy string
RemoteChecksumPolicy governs checksums fetched from an upstream.
const ( GenerateIfAbsent RemoteChecksumPolicy = "generate-if-absent" Fail RemoteChecksumPolicy = "fail" IgnoreAndGenerate RemoteChecksumPolicy = "ignore-and-generate" PassThru RemoteChecksumPolicy = "pass-thru" )
Remote checksum policies.
type SnapshotVersionBehavior ¶
type SnapshotVersionBehavior string
SnapshotVersionBehavior decides how Maven snapshot file names are stored.
const ( Unique SnapshotVersionBehavior = "unique" NonUnique SnapshotVersionBehavior = "non-unique" Deployer SnapshotVersionBehavior = "deployer" )
Snapshot version behaviours.
type TerraformType ¶
type TerraformType string
TerraformType distinguishes module and provider registries.
const ( TerraformModule TerraformType = "MODULE" TerraformProvider TerraformType = "PROVIDER" )
Terraform repository types.
func (*TerraformType) UnmarshalJSON ¶
func (t *TerraformType) UnmarshalJSON(b []byte) error
UnmarshalJSON accepts any case because JFrog's own Terraform provider sends "module" and "provider" while the documentation and the server use upper case.
type VCSGitProvider ¶
type VCSGitProvider string
VCSGitProvider names the Git hosting flavour of a VCS remote.
const ( GitHub VCSGitProvider = "GITHUB" GitHubEnterprise VCSGitProvider = "GITHUBENTERPRISE" GitLab VCSGitProvider = "GITLAB" Bitbucket VCSGitProvider = "BITBUCKET" OldStash VCSGitProvider = "OLDSTASH" Stash VCSGitProvider = "STASH" ArtifactoryVCS VCSGitProvider = "ARTIFACTORY" CustomVCS VCSGitProvider = "CUSTOM" )
VCS Git providers.
type ValidationError ¶
type ValidationError []FieldError
ValidationError is the list of field errors Validate found. It unwraps to ErrInvalid.
func (ValidationError) Error ¶
func (es ValidationError) Error() string
func (ValidationError) Unwrap ¶
func (es ValidationError) Unwrap() error
Unwrap lets errors.Is(err, ErrInvalid) work on the list.