Documentation ¶
Index ¶
- Constants
- Variables
- func AllHclPredicate(predicates ...utils.HclPredicate) utils.HclPredicate
- func CheckRepo(id string, request *resty.Request) (*resty.Response, error)
- func HandleResetWithNonExistantValue(d *utils.ResourceData, key string) string
- func IgnoreHclPredicate(names ...string) utils.HclPredicate
- func MkResourceSchema(skeema map[string]*schema.Schema, packer PackFunc, unpack UnpackFunc, ...) *schema.Resource
- func RepoLayoutRefSchema(repositoryType string, packageType string) map[string]*schema.Schema
- func Retry400(response *resty.Response, err error) bool
- type AutoMapper
- type Constructor
- type ContentSynchronisation
- type ContentSynchronisationProperties
- type ContentSynchronisationSource
- type ContentSynchronisationStatistics
- type Identifiable
- type PackFunc
- type ReadFunc
- type UnpackFunc
Constants ¶
const RepositoriesEndpoint = "artifactory/api/repositories/"
Variables ¶
var CompressionFormats = map[string]*schema.Schema{ "index_compression_formats": { Type: schema.TypeSet, Elem: &schema.Schema{ Type: schema.TypeString, }, Set: schema.HashString, Optional: true, }, }
var NoPassword = IgnoreHclPredicate("class", "rclass", "password")
var ProjectEnvironmentsSupported = []string{"DEV", "PROD"}
var RepoKeyValidator = validation.All( validation.StringDoesNotMatch(regexp.MustCompile("^[0-9].*"), "repo key cannot start with a number"), validation.StringDoesNotContainAny(" !@#$%^&*()+={}[]:;<>,/?~`|\\"), )
var RepoTypesSupported = []string{
"alpine",
"bower",
"cargo",
"chef",
"cocoapods",
"composer",
"conan",
"conda",
"cran",
"debian",
"docker",
"gems",
"generic",
"gitlfs",
"go",
"gradle",
"helm",
"ivy",
"maven",
"npm",
"nuget",
"opkg",
"p2",
"puppet",
"pypi",
"rpm",
"sbt",
"vagrant",
"vcs",
}
Functions ¶
func AllHclPredicate ¶
func AllHclPredicate(predicates ...utils.HclPredicate) utils.HclPredicate
func HandleResetWithNonExistantValue ¶
func HandleResetWithNonExistantValue(d *utils.ResourceData, key string) string
Special handling for field that requires non-existant value for RT
Artifactory REST API will not accept empty string or null to reset value to not set Instead, using a non-existant value works as a workaround To ensure we don't accidentally set the value to a valid value, we use a UUID v4 string
func IgnoreHclPredicate ¶
func IgnoreHclPredicate(names ...string) utils.HclPredicate
func MkResourceSchema ¶
func MkResourceSchema(skeema map[string]*schema.Schema, packer PackFunc, unpack UnpackFunc, constructor Constructor) *schema.Resource
func RepoLayoutRefSchema ¶
Types ¶
type AutoMapper ¶
type AutoMapper func(field reflect.StructField, thing reflect.Value) map[string]interface{}
type Constructor ¶
type Constructor func() interface{}
Constructor Must return a pointer to a struct. When just returning a struct, resty gets confused and thinks it's a map
type ContentSynchronisation ¶
type ContentSynchronisation struct { Enabled bool `json:"enabled"` Statistics ContentSynchronisationStatistics `json:"statistics"` Properties ContentSynchronisationProperties `json:"properties"` Source ContentSynchronisationSource `json:"source"` }
type ContentSynchronisationProperties ¶
type ContentSynchronisationProperties struct {
Enabled bool `hcl:"properties_enabled" json:"enabled"`
}
type ContentSynchronisationSource ¶
type ContentSynchronisationSource struct {
OriginAbsenceDetection bool `hcl:"source_origin_absence_detection" json:"originAbsenceDetection"`
}
type ContentSynchronisationStatistics ¶
type ContentSynchronisationStatistics struct {
Enabled bool `hcl:"statistics_enabled" json:"enabled"`
}
type Identifiable ¶
type Identifiable interface {
Id() string
}
type PackFunc ¶
type PackFunc func(repo interface{}, d *schema.ResourceData) error
func ComposePacker ¶
func UniversalPack ¶
func UniversalPack(predicate utils.HclPredicate) PackFunc
repository.UniversalPack consider making this a function that takes a predicate of what to include and returns a function that does the job. This would allow for the legacy code to specify which keys to keep and not
type ReadFunc ¶
type ReadFunc func(d *schema.ResourceData, m interface{}) error
type UnpackFunc ¶
type UnpackFunc func(s *schema.ResourceData) (interface{}, string, error)
UnpackFunc must return a pointer to a struct and the resource id