artifactory

package
v0.0.0-...-3d30972 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 30 Imported by: 2

Documentation

Index

Constants

View Source
const PropertySeparator = ";"

PropertySeparator is the standard character used by artifactory

Variables

This section is empty.

Functions

func Authentication

func Authentication(user, password, apiKey, accessToken string) func(*Client) error

Authentication sets credentials to be used by the client

func Endpoint

func Endpoint(endpoint string) func(*Client) error

Endpoint is used for accessing Artifactory

Types

type Artifact

type Artifact struct {
	File utils.FileInfo
	Item utils.ResultItem
}

Artifact wraps Artifactory metadata for an artifact

func (*Artifact) JSON

func (a *Artifact) JSON() ([]byte, error)

JSON returns an encoded byte slice of an Artifact

type BasicCredentials

type BasicCredentials struct {
	Username string
	Password string
}

BasicCredentials provides interface for container image pull/push

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for handling requests to the Artifactory AQL API

func NewClient

func NewClient(options ...func(*Client) error) (*Client, error)

NewClient builds the client used to access the API

func (*Client) AQL

func (c *Client) AQL(aql string) ([]byte, error)

AQL returns the results of an AQL request

func (*Client) BasicCredentials

func (c *Client) BasicCredentials() BasicCredentials

BasicCredentials builds the BasicCredentials struct

func (*Client) DownloadItems

func (c *Client) DownloadItems(pattern, target string) ([]Artifact, error)

DownloadItems downloads artifacts

func (*Client) PublishBuildInfo

func (c *Client) PublishBuildInfo(b buildinfo.BuildInfo) error

PublishBuildInfo creates a build in artifactory

func (*Client) PullImage

func (c *Client) PullImage(dest, format, repository, identifier, digest string) error

PullImage downloads an image in etiher OCI or RootFS format

func (*Client) PushImage

func (c *Client) PushImage(src, repository, image string, tags []string) (string, error)

PushImage uploads an image in OCI format

func (*Client) SearchItem

func (c *Client) SearchItem(pattern string) (utils.ResultItem, error)

SearchItem returns metadata for an artifact by pattern

func (*Client) SearchItems

func (c *Client) SearchItems(aql string) ([]utils.ResultItem, error)

SearchItems returns the results of an AQL request

func (*Client) UploadItems

func (c *Client) UploadItems(pattern, target string, props Properties) ([]utils.FileInfo, int, error)

UploadItems downloads artifacts

type ImageMetadata

type ImageMetadata struct {
	Env  []string `json:"env"`
	User string   `json:"user"`
}

ImageMetadata is used for rootfs format

type Properties

type Properties []Property

Properties stores a slice of Property's

func (Properties) Env

func (props Properties) Env() buildinfo.Env

Env converts Properties to Artifactory buildinfo.Env

func (*Properties) FromFile

func (props *Properties) FromFile(p string) error

FromFile reads a simple kv file into Properties

func (Properties) String

func (props Properties) String() string

type Property

type Property struct {
	Name  string
	Value string
}

Property stores an artifact metadata property field / value pair

Jump to

Keyboard shortcuts

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