repository

package
v6.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const RepositoriesEndpoint = "artifactory/api/repositories/"

Variables

View Source
var CompressionFormats = map[string]*schema.Schema{
	"index_compression_formats": {
		Type: schema.TypeSet,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		Set:      schema.HashString,
		Optional: true,
	},
}
View Source
var NoPassword = IgnoreHclPredicate("class", "rclass", "password")
View Source
var ProjectEnvironmentsSupported = []string{"DEV", "PROD"}
View Source
var RepoKeyValidator = validation.All(
	validation.StringDoesNotMatch(regexp.MustCompile("^[0-9].*"), "repo key cannot start with a number"),
	validation.StringDoesNotContainAny(" !@#$%^&*()+={}[]:;<>,/?~`|\\"),
)
View Source
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 CheckRepo

func CheckRepo(id string, request *resty.Request) (*resty.Response, error)

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

func RepoLayoutRefSchema(repositoryType string, packageType string) map[string]*schema.Schema

func Retry400

func Retry400(response *resty.Response, err error) bool

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 ComposePacker(packers ...PackFunc) PackFunc

func DefaultPacker

func DefaultPacker(skeema map[string]*schema.Schema) PackFunc

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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