artifactory

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

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

APIError is a custom Error type for API error

func (*APIError) Error

func (e *APIError) Error() string

type APIErrors

type APIErrors struct {
	Errors interface{}
}

APIErrors represents Artifactory API Error response

type ApiResponse added in v1.9.5

type ApiResponse struct {
	Body   []byte
	NodeId string
}

type BuildInfo

type BuildInfo struct {
	Version  string   `json:"version"`
	Revision string   `json:"revision"`
	Addons   []string `json:"addons"`
	License  string   `json:"license"`
	NodeId   string
}

BuildInfo represents API respond from version endpoint

type Certificate added in v1.14.0

type Certificate struct {
	CertificateAlias string `json:"certificateAlias"`
	IssuedTo         string `json:"issuedTo"`
	IssuedBy         string `json:"issuedBy"`
	IssuedOn         string `json:"issuedOn"`
	ValidUntil       string `json:"validUntil"`
	Fingerprint      string `json:"fingerprint"`
}

Certificate represents a single element of an API response from the certificates endpoint

type Certificates added in v1.14.0

type Certificates struct {
	Certificates []Certificate
	NodeId       string
}

type Client

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

Client represents Artifactory HTTP Client

func NewClient

func NewClient(conf *config.Config) *Client

NewClient returns an initialized Artifactory HTTP Client.

func (*Client) FetchBuildInfo

func (c *Client) FetchBuildInfo() (BuildInfo, error)

FetchBuildInfo makes the API call to version endpoint and returns BuildInfo

func (*Client) FetchCertificates added in v1.14.0

func (c *Client) FetchCertificates() (Certificates, error)

FetchCertificates makes the API call to the certificates endpoint and returns []Certificates

func (*Client) FetchGroups

func (c *Client) FetchGroups() (Groups, error)

FetchGroups makes the API call to groups endpoint and returns []Group

func (*Client) FetchHTTP

func (c *Client) FetchHTTP(path string) (*ApiResponse, error)

FetchHTTP is a wrapper function for making all Get API calls

func (*Client) FetchHealth

func (c *Client) FetchHealth() (HealthStatus, error)

FetchHealth returns true if the ping endpoint returns "OK"

func (*Client) FetchLicense

func (c *Client) FetchLicense() (LicenseInfo, error)

FetchLicense makes the API call to license endpoint and returns LicenseInfo

func (*Client) FetchMirrorLags added in v1.12.0

func (c *Client) FetchMirrorLags() (MirrorLags, error)

FetchMirrorLags makes the API call to federation/status/mirrorsLag endpoint and returns []MirrorLag

func (*Client) FetchOpenMetrics added in v1.14.0

func (c *Client) FetchOpenMetrics() (OpenMetrics, error)

FetchOpenMetrics makes the API call to open metrics endpoint and returns all the open metrics

func (*Client) FetchReplications

func (c *Client) FetchReplications() (Replications, error)

FetchReplications makes the API call to replication endpoint and returns []Replication

func (*Client) FetchStorageInfo

func (c *Client) FetchStorageInfo() (StorageInfo, error)

FetchStorageInfo makes the API call to storageinfo endpoint and returns StorageInfo

func (*Client) FetchUnavailableMirrors added in v1.12.0

func (c *Client) FetchUnavailableMirrors() (UnavailableMirrors, error)

FetchUnavailableMirrors makes the API call to federation/status/unavailableMirrors endpoint and returns []UnavailableMirror

func (*Client) FetchUsers

func (c *Client) FetchUsers() (Users, error)

FetchUsers makes the API call to users endpoint and returns []User

func (*Client) IsFederationEnabled added in v1.12.0

func (c *Client) IsFederationEnabled() bool

IsFederationEnabled checks one of the federation endpoints to see if federation is enabled

func (*Client) QueryAQL

func (c *Client) QueryAQL(query []byte) (*ApiResponse, error)

QueryAQL is a wrapper function for making an query to AQL endpoint

type Group

type Group struct {
	Name  string `json:"name"`
	Realm string `json:"uri"`
}

Group represents single element of API respond from groups endpoint

type Groups added in v1.9.5

type Groups struct {
	Groups []Group
	NodeId string
}

type HealthStatus added in v1.9.5

type HealthStatus struct {
	Healthy bool
	NodeId  string
}

type LicenseInfo

type LicenseInfo struct {
	Type         string `json:"type"`
	ValidThrough string `json:"validThrough"`
	LicensedTo   string `json:"licensedTo"`
	NodeId       string
}

LicenseInfo represents API respond from license endpoint

type MirrorLag added in v1.12.0

type MirrorLag struct {
	LocalRepoKey  string `json:"localRepoKey"`
	RemoteUrl     string `json:"remoteUrl"`
	RemoteRepoKey string `json:"remoteRepoKey"`
	LagInMS       int    `json:"lagInMS"`
}

MirrorLag represents single element of API respond from federation/status/mirrorsLag endpoint

type MirrorLags added in v1.12.0

type MirrorLags struct {
	MirrorLags []MirrorLag
	NodeId     string
}

type OpenMetrics added in v1.14.0

type OpenMetrics struct {
	PromMetrics string
	NodeId      string
}

type Replication

type Replication struct {
	ReplicationType                 string `json:"replicationType"`
	Enabled                         bool   `json:"enabled"`
	CronExp                         string `json:"cronExp"`
	SyncDeletes                     bool   `json:"syncDeletes"`
	SyncProperties                  bool   `json:"syncProperties"`
	PathPrefix                      string `json:"pathPrefix"`
	RepoKey                         string `json:"repoKey"`
	URL                             string `json:"url"`
	EnableEventReplication          bool   `json:"enableEventReplication"`
	CheckBinaryExistenceInFilestore bool   `json:"checkBinaryExistenceInFilestore"`
	SyncStatistics                  bool   `json:"syncStatistics"`
	Status                          string `json:"status"`
}

Replication represents single element of API respond from replication endpoint

type ReplicationStatus added in v1.10.0

type ReplicationStatus struct {
	Status string `json:"status"`
}

type Replications added in v1.9.5

type Replications struct {
	Replications []Replication
	NodeId       string
}

type StorageInfo

type StorageInfo struct {
	BinariesSummary struct {
		BinariesCount  string `json:"binariesCount"`
		BinariesSize   string `json:"binariesSize"`
		ArtifactsSize  string `json:"artifactsSize"`
		Optimization   string `json:"optimization"`
		ItemsCount     string `json:""`
		ArtifactsCount string `json:"artifactsCount"`
	} `json:"binariesSummary"`
	FileStoreSummary struct {
		StorageType      string `json:"storageType"`
		StorageDirectory string `json:"storageDirectory"`
		TotalSpace       string `json:"totalSpace"`
		UsedSpace        string `json:"usedSpace"`
		FreeSpace        string `json:"freeSpace"`
	} `json:"fileStoreSummary"`
	RepositoriesSummaryList []struct {
		RepoKey      string `json:"repoKey"`
		RepoType     string `json:"repoType"`
		FoldersCount int    `json:"foldersCount"`
		FilesCount   int    `json:"filesCount"`
		UsedSpace    string `json:"usedSpace"`
		ItemsCount   int    `json:"itemsCount"`
		PackageType  string `json:"packageType"`
		Percentage   string `json:"percentage"`
	} `json:"repositoriesSummaryList"`
	NodeId string
}

StorageInfo represents API respond from license storageinfo

type UnavailableMirror added in v1.12.0

type UnavailableMirror struct {
	LocalRepoKey  string `json:"localRepoKey"`
	RemoteUrl     string `json:"remoteUrl"`
	RemoteRepoKey string `json:"remoteRepoKey"`
	Status        string `json:"status"`
}

UnavailableMirror represents single element of API respond from federation/status/unavailableMirrors endpoint

type UnavailableMirrors added in v1.12.0

type UnavailableMirrors struct {
	UnavailableMirrors []UnavailableMirror
	NodeId             string
}

type UnmarshalError

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

UnmarshalError is a custom Error type for unmarshal API respond body error

func (*UnmarshalError) Error

func (e *UnmarshalError) Error() string

type User

type User struct {
	Name  string `json:"name"`
	Realm string `json:"realm"`
}

User represents single element of API respond from users endpoint

type Users added in v1.9.5

type Users struct {
	Users  []User
	NodeId string
}

Jump to

Keyboard shortcuts

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