Documentation ¶
Index ¶
- func GetResourceOfType(url string, cred *RegistryAuth, bearerToken string, target interface{}) error
- func MapMerge(base map[string]string, new map[string]string) map[string]string
- type ArtDockerRepo
- type ArtHookStruct
- type ArtImageSHAs
- type ArtImageTags
- type ArtImages
- type ArtReposBySha
- type FakeHandler
- type LogInterface
- type RegistryAuth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResourceOfType ¶
func GetResourceOfType(url string, cred *RegistryAuth, bearerToken string, target interface{}) error
GetResourceOfType takes in the specified URL with credentials and tries to decode returning json to specified interface
Types ¶
type ArtDockerRepo ¶
type ArtDockerRepo []struct { Key string `json:"key"` Type string `json:"type"` URL string `json:"url"` PackageType string `json:"packageType"` }
ArtDockerRepo contains list of docker repos in artifactory
type ArtHookStruct ¶
type ArtHookStruct struct { Artifacts []struct { Type string `json:"type"` Name string `json:"name"` Version string `json:"version"` Reference string `json:"reference"` } `json:"artifacts"` }
ArtHookStruct is the structure returned by Artifactory webhook
type ArtImageSHAs ¶
type ArtImageSHAs struct { Properties struct { Sha256 []string `json:"sha256"` } `json:"properties"` URI string `json:"uri"` }
ArtImageSHAs gets all the sha256 of an image
type ArtImageTags ¶
ArtImageTags lists out all the tags for the image
type ArtImages ¶
type ArtImages struct {
Repositories []string `json:"repositories"`
}
ArtImages contain list of images inside the docker repo
type ArtReposBySha ¶
type ArtReposBySha struct { Results []struct { URI string `json:"uri"` } `json:"results"` }
ArtReposBySha collects URIs for given SHA256
type FakeHandler ¶
type FakeHandler struct { RequestReceived *http.Request RequestBody string StatusCode int RespondBody string T LogInterface }
FakeHandler is to assist in testing HTTP requests
func (*FakeHandler) ServeHTTP ¶
func (f *FakeHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)
type LogInterface ¶
type LogInterface interface { Errorf(format string, args ...interface{}) Logf(format string, args ...interface{}) }
LogInterface is a simple interface providing Errorf an Logf
type RegistryAuth ¶
RegistryAuth stores the credentials for a private docker repo and is same as common.RegistryAuth in perceptor-scanner repo
func PingArtifactoryServer ¶
func PingArtifactoryServer(url string, username string, password string) (*RegistryAuth, error)
PingArtifactoryServer takes in the specified URL with username & password and checks weather it's a valid login for artifactory by pinging the server with various options and returns the correct URL