artifactory

package
Version: v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool2int

func Bool2int(b bool) int

Types

type AQLResult

type AQLResult struct {
	Results []struct {
		Path       string `json:"path"`
		Name       string `json:"name"`
		Properties []struct {
			Key   string `json:"key"`
			Value string `json:"value"`
		} `json:"properties"`
	} `json:"results"`
}

type Client

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

func NewClient

func NewClient(config Config) *Client

func (*Client) CopyArtifact

func (c *Client) CopyArtifact(ctx context.Context, srcRepo, srcPath, destRepo, destPath string, dryRun bool) (*MessagesResponse, error)

func (*Client) DeleteArtifact

func (c *Client) DeleteArtifact(ctx context.Context, repo, path string) (*MessagesResponse, error)

func (*Client) GetArtifactProperties

func (c *Client) GetArtifactProperties(ctx context.Context, repository, path string) (*Properties, error)

GetArtifactProperties for an Artifact.

func (*Client) GetLatestVersion

func (c *Client) GetLatestVersion(ctx context.Context, repository string, path string, version string) (string, error)

func (*Client) GetLatestVersionLessThan

func (c *Client) GetLatestVersionLessThan(ctx context.Context, repository string, path string, lessThanVersion string) (string, error)

GetLatestVersionLessThan Retrieves the latest version of an Artifact that is is less than the one specified TODO: pull logic out from below and document up here

func (*Client) MoveArtifact

func (c *Client) MoveArtifact(ctx context.Context, srcRepo, srcPath, destRepo, destPath string, dryRun bool) (*MessagesResponse, error)

type Config

type Config struct {
	ArtifactoryApiKey  string        `split_words:"true" required:"true"`
	ArtifactoryBaseUrl string        `split_words:"true" required:"true"`
	ArtifactoryTimeout time.Duration `split_words:"true" default:"20s"`
}

type ErrorResponse

type ErrorResponse struct {
	Errors []Status `json:"errors,omitempty"` // Individual errors
}

ErrorResponse reports one or more errors caused by an API request.

func (ErrorResponse) Error

func (r ErrorResponse) Error() string

type InvalidRequestError

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

func InvalidRequestErrorf

func InvalidRequestErrorf(format string, a ...interface{}) InvalidRequestError

func (InvalidRequestError) Error

func (e InvalidRequestError) Error() string

func (InvalidRequestError) IsEveError

func (e InvalidRequestError) IsEveError() bool

type Message

type Message struct {
	Level   string `json:"level"`
	Message string `json:"message"`
}

type MessagesResponse

type MessagesResponse struct {
	Messages []Message `json:"messages"`
}

func (MessagesResponse) Error

func (mr MessagesResponse) Error() string

func (MessagesResponse) ToString

func (mr MessagesResponse) ToString() string

func (MessagesResponse) ToStrings

func (mr MessagesResponse) ToStrings() []string

type MoveRequest

type MoveRequest struct {
	RepoKey       string `json:"repoKey"`
	Path          string `json:"path"`
	TargetRepoKey string `json:"targetRepoKey"`
	TargetPath    string `json:"targetPath"`
}

type NotFoundError

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

func NotFoundErrorf

func NotFoundErrorf(format string, a ...interface{}) NotFoundError

func (NotFoundError) Error

func (e NotFoundError) Error() string

func (NotFoundError) IsEveError

func (e NotFoundError) IsEveError() bool

type Properties

type Properties struct {
	Properties map[string][]string `json:"properties"`
	URI        string              `json:"uri"`
}

func (Properties) Property

func (p Properties) Property(key string) string

type ServiceUnavailableError

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

func ServiceUnavailableErrorf

func ServiceUnavailableErrorf(format string, a ...interface{}) ServiceUnavailableError

func (ServiceUnavailableError) Error

func (e ServiceUnavailableError) Error() string

func (ServiceUnavailableError) IsEveError

func (e ServiceUnavailableError) IsEveError() bool

type Status

type Status struct {
	Status  int    `json:"status"`  // Validation error status code
	Message string `json:"message"` // Message describing the error. Errors with Code == "custom" will always have this set.
}

Status is the individual error provided by the API

func (*Status) Error

func (e *Status) Error() string

type VersionResponse

type VersionResponse struct {
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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