registryv1

package
v0.0.0-...-a3be206 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
const ErrCodeAPICreation = "APICreationError"

ErrCodeAPICreation ...

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildTargetHeader

type BuildTargetHeader struct {
	AccountID string
}

func (BuildTargetHeader) ToMap

func (c BuildTargetHeader) ToMap() map[string]string

ToMap ...

type Builds

type Builds interface {
	ImageBuild(params ImageBuildRequest, buildContext io.Reader, target BuildTargetHeader, out io.Writer) error
	ImageBuildCallback(params ImageBuildRequest, buildContext io.Reader, target BuildTargetHeader, callback ImageBuildResponseCallback) error
}

Subnets interface

type DeleteImageResponse

type DeleteImageResponse struct {
	Untagged string `json:"Untagged"`
}

type Digesttags

type Digesttags struct {
	Tags map[string][]string
}

type Errordetail

type Errordetail struct {
	Message string `json:"message,omitempty"`
}

Errordetail

type GetImageRequest

type GetImageRequest struct {
	/*IncludeIBM
	  Includes IBM-provided public images in the list of images. If this option is not specified, private images are listed only. If this option is specified more than once, the last parsed setting is the setting that is used.
	*/
	IncludeIBM bool
	/*IncludePrivate
	  Includes private images in the list of images. If this option is not specified, private images are listed. If this option is specified more than once, the last parsed setting is the setting that is used.
	*/
	IncludePrivate bool
	/*Namespace
	  Lists images that are stored in the specified namespace only. Query multiple namespaces by specifying this option for each namespace. If this option is not specified, images from all namespaces in the specified IBM Cloud account are listed.
	*/
	Namespace string
	/*Repository
	  Lists images that are stored in the specified repository, under your namespaces. Query multiple repositories by specifying this option for each repository. If this option is not specified, images from all repos are listed.
	*/
	Repository string
	/*Vulnerabilities
	  Displays Vulnerability Advisor status for the listed images. If this option is specified more than once, the last parsed setting is the setting that is used.
	*/
	Vulnerabilities bool
}

GetImageRequest contains all the parameters to send to the API endpoint for the image list operation typically these are written to a http.Request

func DefaultGetImageRequest

func DefaultGetImageRequest() *GetImageRequest

type GetImagesResponse

type GetImagesResponse []struct {
	ID                      string              `json:"Id"`
	ParentID                string              `json:"ParentId"`
	DigestTags              map[string][]string `json:"DigestTags"`
	RepoTags                []string            `json:"RepoTags"`
	RepoDigests             []string            `json:"RepoDigests"`
	Created                 int                 `json:"Created"`
	Size                    int64               `json:"Size"`
	VirtualSize             int64               `json:"VirtualSize"`
	Labels                  map[string]string   `json:"Labels"`
	Vulnerable              string              `json:"Vulnerable"`
	VulnerabilityCount      int                 `json:"VulnerabilityCount"`
	ConfigurationIssueCount int                 `json:"ConfigurationIssueCount"`
	IssueCount              int                 `json:"IssueCount"`
	ExemptIssueCount        int                 `json:"ExemptIssueCount"`
}

type GetTokensResponse

type GetTokensResponse struct {
	Tokens []struct {
		ID             string `json:"_id,omitempty"`
		Owner          string `json:"owner,omitempty"`
		Token          string `json:"token,omitempty"`
		Description    string `json:"secondary_owner,omitempty"`
		Readonly       bool   `json:"readonly,omitempty"`
		Revoked        bool   `json:"revoked,omitempty"`
		Expiry         int64  `json:"expiry,omitempty"`
		EncryptedToken string `json:"encrypted_token,omitempty"`
	} `json:"tokens,omitempty"`
}

type ImageBuildRequest

type ImageBuildRequest struct {
	/*T
	  The full name for the image that you want to build, including the registry URL and namespace.
	*/
	T string
	/*F
	  Specify the location of the Dockerfile relative to the build context. If not specified, the default is 'PATH/Dockerfile', where PATH is the root of the build context.
	*/
	Dockerfile string
	/*Buildargs
	  A JSON key-value structure that contains build arguments. The value of the build arguments are available as environment variables when you specify an `ARG` line which matches the key in your Dockerfile.
	*/
	Buildargs string
	/*Nocache
	  If set to true, cached image layers from previous builds are not used in this build. Use this option if you expect the result of commands that run in the build to change.
	*/
	Nocache bool
	/*Pull
	  If set to true, the base image is pulled even if an image with a matching tag already exists on the build host. The base image is specified by using the FROM keyword in your Dockerfile. Use this option to update the version of the base image on the build host.
	*/
	Pull bool
	/*Quiet
	  If set to true, build output is suppressed unless an error occurs.
	*/
	Quiet bool
	/*Squash
	  If set to true, the filesystem of the built image is reduced to one layer before it is pushed to the registry. Use this option if the number of layers in your image is close to the maximum for your storage driver.
	*/
	Squash bool
}

func DefaultImageBuildRequest

func DefaultImageBuildRequest() *ImageBuildRequest

type ImageBuildResponse

type ImageBuildResponse struct {
	ID             string                 `json:"id,omitempty"`
	Stream         string                 `json:"stream,omitempty"`
	Status         string                 `json:"status,omitempty"`
	ProgressDetail Progressdetail         `json:"progressDetail,omitempty"`
	Error          string                 `json:"error,omitempty"`
	ErrorDetail    Errordetail            `json:"errorDetail,omitempty"`
	Aux            map[string]interface{} `json:"aux"`
}

ImageBuildResponse

type ImageBuildResponseCallback

type ImageBuildResponseCallback func(respV ImageBuildResponse) bool

Callback function for build response stream

type ImageInspectResponse

type ImageInspectResponse struct {
	ID              string    `json:"Id"`
	Parent          string    `json:"Parent"`
	Comment         string    `json:"Comment"`
	Created         time.Time `json:"Created"`
	Container       string    `json:"Container"`
	ContainerConfig struct {
		Hostname     string                 `json:"Hostname"`
		Domainname   string                 `json:"Domainname"`
		User         string                 `json:"User"`
		AttachStdin  bool                   `json:"AttachStdin"`
		AttachStdout bool                   `json:"AttachStdout"`
		AttachStderr bool                   `json:"AttachStderr"`
		ExposedPorts map[string]interface{} `json:"ExposedPorts"`
		Tty          bool                   `json:"Tty"`
		OpenStdin    bool                   `json:"OpenStdin"`
		StdinOnce    bool                   `json:"StdinOnce"`
		Env          []string               `json:"Env"`
		Cmd          []string               `json:"Cmd"`
		ArgsEscaped  bool                   `json:"ArgsEscaped"`
		Image        string                 `json:"Image"`
		Volumes      map[string]interface{} `json:"Volumes"`
		WorkingDir   string                 `json:"WorkingDir"`
		Entrypoint   []string               `json:"Entrypoint"`
		OnBuild      []string               `json:"OnBuild"`
		Labels       map[string]string      `json:"Labels"`
	} `json:"ContainerConfig"`
	DockerVersion string `json:"DockerVersion"`
	Author        string `json:"Author"`
	Config        struct {
		Hostname     string                 `json:"Hostname"`
		Domainname   string                 `json:"Domainname"`
		User         string                 `json:"User"`
		AttachStdin  bool                   `json:"AttachStdin"`
		AttachStdout bool                   `json:"AttachStdout"`
		AttachStderr bool                   `json:"AttachStderr"`
		ExposedPorts map[string]interface{} `json:"ExposedPorts"`
		Tty          bool                   `json:"Tty"`
		OpenStdin    bool                   `json:"OpenStdin"`
		StdinOnce    bool                   `json:"StdinOnce"`
		Env          []string               `json:"Env"`
		Cmd          []string               `json:"Cmd"`
		ArgsEscaped  bool                   `json:"ArgsEscaped"`
		Image        string                 `json:"Image"`
		Volumes      map[string]interface{} `json:"Volumes"`
		WorkingDir   string                 `json:"WorkingDir"`
		Entrypoint   []string               `json:"Entrypoint"`
		OnBuild      []string               `json:"OnBuild"`
		Labels       map[string]string      `json:"Labels"`
	} `json:"Config"`
	Architecture string `json:"Architecture"`
	Os           string `json:"Os"`
	Size         int64  `json:"Size"`
	VirtualSize  int64  `json:"VirtualSize"`
	RootFS       struct {
		Type   string   `json:"Type"`
		Layers []string `json:"Layers"`
	} `json:"RootFS"`
}

type ImageTargetHeader

type ImageTargetHeader struct {
	AccountID string
}

func (ImageTargetHeader) ToMap

func (c ImageTargetHeader) ToMap() map[string]string

ToMap ...

type ImageVulnerabilitiesRequest

type ImageVulnerabilitiesRequest struct {

	/*Advisory
	  Specifies to include advisory compliance checks in the report.
	*/
	Advisory bool
	/*All
	  Specifies to include all checks in the report. If not specified or false, only failing checks are returned.
	*/
	All bool
}

func DefaultImageVulnerabilitiesRequest

func DefaultImageVulnerabilitiesRequest() *ImageVulnerabilitiesRequest

type ImageVulnerabilitiesResponse

type ImageVulnerabilitiesResponse struct {
	Metadata struct {
		Namespace   string    `json:"namespace"`
		Complete    bool      `json:"complete"`
		CrawledTime time.Time `json:"crawled_time"`
		OsSupported bool      `json:"os_supported"`
	} `json:"metadata"`
	Summary struct {
		Malware struct {
			Compliant bool   `json:"compliant"`
			Reason    string `json:"reason"`
		} `json:"malware"`
		Compliance struct {
			ComplianceViolations int    `json:"compliance_violations"`
			Reason               string `json:"reason"`
			Compliant            bool   `json:"compliant"`
			TotalComplianceRules int    `json:"total_compliance_rules"`
			ExecutionStatus      string `json:"execution_status"`
		} `json:"compliance"`
		Secureconfig struct {
			Misconfigured   int `json:"misconfigured"`
			CorrectOutput   int `json:"correct_output"`
			TotalOutputDocs int `json:"total_output_docs"`
		} `json:"secureconfig"`
		Vulnerability struct {
			TotalPackages      int `json:"total_packages"`
			TotalUsnsForDistro int `json:"total_usns_for_distro"`
			VulnerableUsns     int `json:"vulnerable_usns"`
			VulnerablePackages int `json:"vulnerable_packages"`
		} `json:"vulnerability"`
	} `json:"summary"`
	Detail struct {
		Compliance []struct {
			Reason         string `json:"reason"`
			Compliant      bool   `json:"compliant"`
			Description    string `json:"description"`
			PolicyMandated bool   `json:"policy_mandated"`
		} `json:"compliance"`
		Vulnerability []struct {
			PackageName     string `json:"package_name"`
			Vulnerabilities []struct {
				URL     string   `json:"url"`
				Cveid   []string `json:"cveid"`
				Summary string   `json:"summary"`
			} `json:"vulnerabilities"`
		} `json:"vulnerability"`
	} `json:"detail"`
}

type Images

type Images interface {
	GetImages(params GetImageRequest, target ImageTargetHeader) (*GetImagesResponse, error)
	InspectImage(imageName string, target ImageTargetHeader) (*ImageInspectResponse, error)
	DeleteImage(imageName string, target ImageTargetHeader) (*DeleteImageResponse, error)
	ImageVulnerabilities(imageName string, param ImageVulnerabilitiesRequest, target ImageTargetHeader) (*ImageVulnerabilitiesResponse, error)
}

Subnets interface

type IssueTokenRequest

type IssueTokenRequest struct {
	/*Description
	  Specifies a description for the token so it can be more easily identified. If this option is specified more than once, the last parsed setting is the setting that is used.
	*/
	Description string
	/*Permanent
	  When specified, the access token does not expire. If this option is specified more than once, the last parsed setting is the setting that is used.
	*/
	Permanent bool
	/*Write
	  When specified, the token provides write access to registry namespaces in your IBM Cloud account. If this option is not specified, or is set to false, the token provides read-only access. If this option is specified more than once, the last parsed setting is the setting that is used.
	*/
	Write bool
}

TokenIssueParams contains all the parameters to send to the API endpoint for the token issue operation typically these are written to a http.Request

func DefaultIssueTokenRequest

func DefaultIssueTokenRequest() *IssueTokenRequest

type Labels

type Labels struct {
	Labels map[string][]string
}

type NamespaceInfo

type NamespaceInfo struct {
	AccountID           string `json:"account,omitempty"`
	CreatedDate         string `json:"created_date,omitempty"`
	CRN                 string `json:"crn,omitempty"`
	Name                string `json:"name,omitempty"`
	ResourceCreatedDate string `json:"resource_created_date,omitempty"`
	ResourceGroup       string `json:"resource_group,omitempty"`
	UpdatedDate         string `json:"updated_date,omitempty"`
}

NamespaceInfo ...

type NamespaceTargetHeader

type NamespaceTargetHeader struct {
	AccountID     string
	ResourceGroup string
}

NamespaceTargetHeader ...

func (NamespaceTargetHeader) ToMap

func (c NamespaceTargetHeader) ToMap() map[string]string

ToMap ...

type Namespaces

type Namespaces interface {
	GetNamespaces(target NamespaceTargetHeader) ([]string, error)
	AddNamespace(namespace string, target NamespaceTargetHeader) (*PutNamespaceResponse, error)
	DeleteNamespace(namespace string, target NamespaceTargetHeader) error
	AssignNamespace(namespace string, target NamespaceTargetHeader) (*PutNamespaceResponse, error)
	GetDetailedNamespaces(target NamespaceTargetHeader) ([]NamespaceInfo, error)
}

Namespaces ...

type Progressdetail

type Progressdetail struct {
	Current int `json:"current,omitempty"`
	Total   int `json:"total,omitempty"`
}

Progressdetail

type PutNamespaceResponse

type PutNamespaceResponse struct {
	Namespace string `json:"namespace,omitempty"`
}

PutNamespaceResponse ...

type RegistryServiceAPI

type RegistryServiceAPI interface {
	Builds() Builds
	Namespaces() Namespaces
	Tokens() Tokens
	Images() Images
}

RegistryServiceAPI is the IBM Cloud Registry client ...

func New

New ...

type TokenResponse

type TokenResponse struct {
	ID    string
	Token string `json:"token,omitempty"`
}

type TokenTargetHeader

type TokenTargetHeader struct {
	AccountID string
}

func (TokenTargetHeader) ToMap

func (c TokenTargetHeader) ToMap() map[string]string

ToMap ...

type Tokens

type Tokens interface {
	GetToken(tokenUUID string, target TokenTargetHeader) (*TokenResponse, error)
	GetTokens(target TokenTargetHeader) (*GetTokensResponse, error)
	DeleteToken(tokenUUID string, target TokenTargetHeader) error
	DeleteTokenByDescription(tokenDescription string, target TokenTargetHeader) error
	IssueToken(params IssueTokenRequest, target TokenTargetHeader) (*TokenResponse, error)
}

Subnets interface

Jump to

Keyboard shortcuts

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