services

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const SCAN_BUILD_API_URL = "api/xray/scanBuild"
View Source
const XRAY_FATAL_FAIL_STATUS = -1
View Source
const XRAY_SCAN_CONNECTION_TIMEOUT = 90 * time.Second // Expecting \r\n every 30 seconds
View Source
const XRAY_SCAN_RETRY_CONSECUTIVE_RETRIES = 10 // Retrying to resume the scan 10 times after a stable connection
View Source
const XRAY_SCAN_SLEEP_BETWEEN_RETRIES = 15 * time.Second // 15 seconds sleep between retry
View Source
const XRAY_SCAN_STABLE_CONNECTION_WINDOW = 100 * time.Second

Variables

This section is empty.

Functions

func SearchBySpecFiles

func SearchBySpecFiles(searchParams SearchParams, flags utils.CommonConf, requiredArtifactProps utils.RequiredArtifactProps) ([]utils.ResultItem, error)

Types

type AqlService

type AqlService struct {
	ArtDetails auth.ArtifactoryDetails
	// contains filtered or unexported fields
}

func NewAqlService

func NewAqlService(client *rthttpclient.ArtifactoryHttpClient) *AqlService

func (*AqlService) ExecAql

func (s *AqlService) ExecAql(aql string) ([]byte, error)

func (*AqlService) GetArtifactoryDetails

func (s *AqlService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*AqlService) GetJfrogHttpClient

func (s *AqlService) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)

func (*AqlService) IsDryRun

func (s *AqlService) IsDryRun() bool

func (*AqlService) SetArtifactoryDetails

func (s *AqlService) SetArtifactoryDetails(rt auth.ArtifactoryDetails)

type BuildDistributionBody

type BuildDistributionBody struct {
	SourceRepos           []string `json:"sourceRepos,omitempty"`
	TargetRepo            string   `json:"targetRepo,omitempty"`
	GpgPassphrase         string   `json:"gpgPassphrase,omitempty"`
	Publish               bool     `json:"publish"`
	OverrideExistingFiles bool     `json:"overrideExistingFiles,omitempty"`
	Async                 bool     `json:"async,omitempty"`
	DryRun                bool     `json:"dryRun,omitempty"`
}

type BuildDistributionParams

type BuildDistributionParams struct {
	SourceRepos           string
	TargetRepo            string
	GpgPassphrase         string
	Publish               bool
	OverrideExistingFiles bool
	Async                 bool
	BuildName             string
	BuildNumber           string
}

func NewBuildDistributionParams

func NewBuildDistributionParams() BuildDistributionParams

func (*BuildDistributionParams) GetBuildName

func (bd *BuildDistributionParams) GetBuildName() string

func (*BuildDistributionParams) GetBuildNumber

func (bd *BuildDistributionParams) GetBuildNumber() string

func (*BuildDistributionParams) GetGpgPassphrase

func (bd *BuildDistributionParams) GetGpgPassphrase() string

func (*BuildDistributionParams) GetSourceRepos

func (bd *BuildDistributionParams) GetSourceRepos() string

func (*BuildDistributionParams) GetTargetRepo

func (bd *BuildDistributionParams) GetTargetRepo() string

func (*BuildDistributionParams) IsAsync

func (bd *BuildDistributionParams) IsAsync() bool

func (*BuildDistributionParams) IsOverrideExistingFiles

func (bd *BuildDistributionParams) IsOverrideExistingFiles() bool

func (*BuildDistributionParams) IsPublish

func (bd *BuildDistributionParams) IsPublish() bool

type BuildInfoParams

type BuildInfoParams struct {
	BuildName   string
	BuildNumber string
}

func NewBuildInfoParams

func NewBuildInfoParams() BuildInfoParams

type BuildInfoService

type BuildInfoService struct {
	ArtDetails auth.ArtifactoryDetails
	DryRun     bool
	// contains filtered or unexported fields
}

func (*BuildInfoService) GetArtifactoryDetails

func (bis *BuildInfoService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*BuildInfoService) GetBuildInfo

func (bis *BuildInfoService) GetBuildInfo(params BuildInfoParams) (*buildinfo.BuildInfo, error)

func (*BuildInfoService) GetJfrogHttpClient

func (bis *BuildInfoService) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)

func (*BuildInfoService) IsDryRun

func (bis *BuildInfoService) IsDryRun() bool

func (*BuildInfoService) PublishBuildInfo

func (bis *BuildInfoService) PublishBuildInfo(build *buildinfo.BuildInfo) error

func (*BuildInfoService) SetArtifactoryDetails

func (bis *BuildInfoService) SetArtifactoryDetails(rt auth.ArtifactoryDetails)

type BuildPromotionBody

type BuildPromotionBody struct {
	Comment             string              `json:"comment,omitempty"`
	SourceRepo          string              `json:"sourceRepo,omitempty"`
	TargetRepo          string              `json:"targetRepo,omitempty"`
	Status              string              `json:"status,omitempty"`
	IncludeDependencies bool                `json:"dependencies,omitempty"`
	Copy                bool                `json:"copy,omitempty"`
	DryRun              bool                `json:"dryRun,omitempty"`
	Properties          map[string][]string `json:"properties, omitempty"`
}

type DeleteConfiguration

type DeleteConfiguration struct {
	ArtDetails auth.ArtifactoryDetails
	DryRun     bool
}

func (*DeleteConfiguration) GetArtifactoryDetails

func (conf *DeleteConfiguration) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*DeleteConfiguration) IsDryRun

func (conf *DeleteConfiguration) IsDryRun() bool

func (*DeleteConfiguration) SetArtifactoryDetails

func (conf *DeleteConfiguration) SetArtifactoryDetails(art auth.ArtifactoryDetails)

type DeleteParams

type DeleteParams struct {
	*utils.ArtifactoryCommonParams
}

func NewDeleteParams

func NewDeleteParams() DeleteParams

func (*DeleteParams) GetFile

func (*DeleteParams) SetIncludeDirs

func (ds *DeleteParams) SetIncludeDirs(includeDirs bool)

type DeleteService

type DeleteService struct {
	ArtDetails auth.ArtifactoryDetails
	DryRun     bool
	// contains filtered or unexported fields
}

func NewDeleteService

func NewDeleteService(client *rthttpclient.ArtifactoryHttpClient) *DeleteService

func (*DeleteService) DeleteFiles

func (ds *DeleteService) DeleteFiles(deleteItems []utils.ResultItem) (int, error)

func (*DeleteService) GetArtifactoryDetails

func (ds *DeleteService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*DeleteService) GetJfrogHttpClient

func (ds *DeleteService) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)

func (*DeleteService) GetPathsToDelete

func (ds *DeleteService) GetPathsToDelete(deleteParams DeleteParams) (resultItems []utils.ResultItem, err error)

func (*DeleteService) IsDryRun

func (ds *DeleteService) IsDryRun() bool

func (*DeleteService) SetArtifactoryDetails

func (ds *DeleteService) SetArtifactoryDetails(rt auth.ArtifactoryDetails)

type DiscardBuildsBody

type DiscardBuildsBody struct {
	MinimumBuildDate string   `json:"minimumBuildDate,omitempty"`
	MaxBuilds        string   `json:"count,omitempty"`
	ExcludeBuilds    []string `json:"buildNumbersNotToBeDiscarded,omitempty"`
	DeleteArtifacts  bool     `json:"deleteBuildArtifacts"`
}

type DiscardBuildsParams

type DiscardBuildsParams struct {
	DeleteArtifacts bool
	BuildName       string
	MaxDays         string
	MaxBuilds       string
	ExcludeBuilds   string
	Async           bool
}

func NewDiscardBuildsParams

func NewDiscardBuildsParams() DiscardBuildsParams

func (*DiscardBuildsParams) GetBuildName

func (bd *DiscardBuildsParams) GetBuildName() string

func (*DiscardBuildsParams) GetExcludeBuilds

func (bd *DiscardBuildsParams) GetExcludeBuilds() string

func (*DiscardBuildsParams) GetMaxBuilds

func (bd *DiscardBuildsParams) GetMaxBuilds() string

func (*DiscardBuildsParams) GetMaxDays

func (bd *DiscardBuildsParams) GetMaxDays() string

func (*DiscardBuildsParams) IsAsync

func (bd *DiscardBuildsParams) IsAsync() bool

func (*DiscardBuildsParams) IsDeleteArtifacts

func (bd *DiscardBuildsParams) IsDeleteArtifacts() bool

type DiscardBuildsService

type DiscardBuildsService struct {
	ArtDetails auth.ArtifactoryDetails
	// contains filtered or unexported fields
}

func (*DiscardBuildsService) DiscardBuilds

func (ds *DiscardBuildsService) DiscardBuilds(params DiscardBuildsParams) error

type DistributeService

type DistributeService struct {
	ArtDetails auth.ArtifactoryDetails
	DryRun     bool
	// contains filtered or unexported fields
}

func (*DistributeService) BuildDistribute

func (ds *DistributeService) BuildDistribute(params BuildDistributionParams) error

type DownloadData

type DownloadData struct {
	Dependency   utils.ResultItem
	DownloadPath string
	Target       string
	Flat         bool
}

type DownloadParams

type DownloadParams struct {
	*utils.ArtifactoryCommonParams
	Symlink         bool
	ValidateSymlink bool
	Flat            bool
	Explode         bool
	MinSplitSize    int64
	SplitCount      int
	Retries         int
}

func NewDownloadParams

func NewDownloadParams() DownloadParams

func (*DownloadParams) GetFile

func (*DownloadParams) GetRetries

func (ds *DownloadParams) GetRetries() int

func (*DownloadParams) IsExplode

func (ds *DownloadParams) IsExplode() bool

func (*DownloadParams) IsFlat

func (ds *DownloadParams) IsFlat() bool
func (ds *DownloadParams) IsSymlink() bool
func (ds *DownloadParams) ValidateSymlinks() bool

type DownloadService

type DownloadService struct {
	Progress   io.Progress
	ArtDetails auth.ArtifactoryDetails
	DryRun     bool
	Threads    int
	// contains filtered or unexported fields
}

func (*DownloadService) DownloadFiles

func (ds *DownloadService) DownloadFiles(downloadParams ...DownloadParams) ([]utils.FileInfo, int, error)

func (*DownloadService) GetArtifactoryDetails

func (ds *DownloadService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*DownloadService) GetJfrogHttpClient

func (ds *DownloadService) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)

func (*DownloadService) GetThreads

func (ds *DownloadService) GetThreads() int

func (*DownloadService) IsDryRun

func (ds *DownloadService) IsDryRun() bool

func (*DownloadService) SetArtDetails

func (ds *DownloadService) SetArtDetails(artDetails auth.ArtifactoryDetails)

func (*DownloadService) SetArtifactoryDetails

func (ds *DownloadService) SetArtifactoryDetails(rt auth.ArtifactoryDetails)

func (*DownloadService) SetDryRun

func (ds *DownloadService) SetDryRun(isDryRun bool)

func (*DownloadService) SetThreads

func (ds *DownloadService) SetThreads(threads int)

type GitLfsCleanParams

type GitLfsCleanParams struct {
	Refs    string
	Repo    string
	GitPath string
}

func NewGitLfsCleanParams

func NewGitLfsCleanParams() GitLfsCleanParams

func (*GitLfsCleanParams) GetGitPath

func (glc *GitLfsCleanParams) GetGitPath() string

func (*GitLfsCleanParams) GetRef

func (glc *GitLfsCleanParams) GetRef() string

func (*GitLfsCleanParams) GetRepo

func (glc *GitLfsCleanParams) GetRepo() string

type GitLfsCleanService

type GitLfsCleanService struct {
	ArtDetails auth.ArtifactoryDetails
	DryRun     bool
	// contains filtered or unexported fields
}

func (*GitLfsCleanService) GetArtifactoryDetails

func (glc *GitLfsCleanService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*GitLfsCleanService) GetJfrogHttpClient

func (glc *GitLfsCleanService) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)

func (*GitLfsCleanService) GetUnreferencedGitLfsFiles

func (glc *GitLfsCleanService) GetUnreferencedGitLfsFiles(gitLfsCleanParams GitLfsCleanParams) ([]utils.ResultItem, error)

func (*GitLfsCleanService) IsDryRun

func (glc *GitLfsCleanService) IsDryRun() bool

func (*GitLfsCleanService) SetArtifactoryDetails

func (glc *GitLfsCleanService) SetArtifactoryDetails(art auth.ArtifactoryDetails)

type MoveCopyParams

type MoveCopyParams struct {
	*utils.ArtifactoryCommonParams
	Flat bool
}

func NewMoveCopyParams

func NewMoveCopyParams() MoveCopyParams

func (*MoveCopyParams) GetFile

func (*MoveCopyParams) IsFlat

func (mc *MoveCopyParams) IsFlat() bool

func (*MoveCopyParams) SetIncludeDir

func (mc *MoveCopyParams) SetIncludeDir(isIncludeDir bool)

type MoveCopyService

type MoveCopyService struct {
	DryRun     bool
	ArtDetails auth.ArtifactoryDetails
	// contains filtered or unexported fields
}

func NewMoveCopyService

func NewMoveCopyService(client *rthttpclient.ArtifactoryHttpClient, moveType MoveType) *MoveCopyService

func (*MoveCopyService) GetArtifactoryDetails

func (mc *MoveCopyService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*MoveCopyService) GetJfrogHttpClient

func (mc *MoveCopyService) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)

func (*MoveCopyService) IsDryRun

func (mc *MoveCopyService) IsDryRun() bool

func (*MoveCopyService) MoveCopyServiceMoveFilesWrapper

func (mc *MoveCopyService) MoveCopyServiceMoveFilesWrapper(moveSpec MoveCopyParams) (successCount, failedCount int, err error)

func (*MoveCopyService) SetArtifactoryDetails

func (mc *MoveCopyService) SetArtifactoryDetails(rt auth.ArtifactoryDetails)

type MoveOptions

type MoveOptions struct {
	MovingMsg string
	MovedMsg  string
}

type MoveType

type MoveType string
const (
	MOVE MoveType = "move"
	COPY MoveType = "copy"
)

type PingService

type PingService struct {
	ArtDetails auth.ArtifactoryDetails
	// contains filtered or unexported fields
}

func NewPingService

func NewPingService(client *rthttpclient.ArtifactoryHttpClient) *PingService

func (*PingService) GetArtifactoryDetails

func (ps *PingService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*PingService) GetJfrogHttpClient

func (ps *PingService) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)

func (*PingService) IsDryRun

func (ps *PingService) IsDryRun() bool

func (*PingService) Ping

func (ps *PingService) Ping() ([]byte, error)

func (*PingService) SetArtifactoryDetails

func (ps *PingService) SetArtifactoryDetails(rt auth.ArtifactoryDetails)

type PromoteService

type PromoteService struct {
	ArtDetails auth.ArtifactoryDetails
	DryRun     bool
	// contains filtered or unexported fields
}

func NewPromotionService

func NewPromotionService(client *rthttpclient.ArtifactoryHttpClient) *PromoteService

func (*PromoteService) BuildPromote

func (ps *PromoteService) BuildPromote(promotionParams PromotionParams) error

type PromotionParams

type PromotionParams struct {
	BuildName           string
	BuildNumber         string
	TargetRepo          string
	Status              string
	Comment             string
	Copy                bool
	IncludeDependencies bool
	SourceRepo          string
	Properties          string
}

func NewPromotionParams

func NewPromotionParams() PromotionParams

func (*PromotionParams) GetBuildName

func (bp *PromotionParams) GetBuildName() string

func (*PromotionParams) GetBuildNumber

func (bp *PromotionParams) GetBuildNumber() string

func (*PromotionParams) GetComment

func (bp *PromotionParams) GetComment() string

func (*PromotionParams) GetProperties

func (bp *PromotionParams) GetProperties() string

func (*PromotionParams) GetSourceRepo

func (bp *PromotionParams) GetSourceRepo() string

func (*PromotionParams) GetStatus

func (bp *PromotionParams) GetStatus() string

func (*PromotionParams) GetTargetRepo

func (bp *PromotionParams) GetTargetRepo() string

func (*PromotionParams) IsCopy

func (bp *PromotionParams) IsCopy() bool

func (*PromotionParams) IsIncludeDependencies

func (bp *PromotionParams) IsIncludeDependencies() bool

type PropsParams

type PropsParams struct {
	Items []utils.ResultItem
	Props string
}

func NewPropsParams

func NewPropsParams() PropsParams

func (*PropsParams) GetItems

func (sp *PropsParams) GetItems() []utils.ResultItem

func (*PropsParams) GetProps

func (sp *PropsParams) GetProps() string

type PropsService

type PropsService struct {
	ArtDetails auth.ArtifactoryDetails
	Threads    int
	// contains filtered or unexported fields
}

func NewPropsService

func NewPropsService(client *rthttpclient.ArtifactoryHttpClient) *PropsService

func (*PropsService) DeleteProps

func (ps *PropsService) DeleteProps(propsParams PropsParams) (int, error)

func (*PropsService) GetArtifactoryDetails

func (ps *PropsService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*PropsService) GetThreads

func (ps *PropsService) GetThreads() int

func (*PropsService) IsDryRun

func (ps *PropsService) IsDryRun() bool

func (*PropsService) SetArtifactoryDetails

func (ps *PropsService) SetArtifactoryDetails(rt auth.ArtifactoryDetails)

func (*PropsService) SetProps

func (ps *PropsService) SetProps(propsParams PropsParams) (int, error)

type ReadFileService

type ReadFileService struct {
	ArtDetails   auth.ArtifactoryDetails
	DryRun       bool
	MinSplitSize int64
	SplitCount   int
	// contains filtered or unexported fields
}

func (*ReadFileService) GetArtifactoryDetails

func (ds *ReadFileService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*ReadFileService) GetJfrogHttpClient

func (ds *ReadFileService) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)

func (*ReadFileService) IsDryRun

func (ds *ReadFileService) IsDryRun() bool

func (*ReadFileService) ReadRemoteFile

func (ds *ReadFileService) ReadRemoteFile(downloadPath string) (io.ReadCloser, error)

func (*ReadFileService) SetArtDetails

func (ds *ReadFileService) SetArtDetails(artDetails auth.ArtifactoryDetails)

func (*ReadFileService) SetArtifactoryDetails

func (ds *ReadFileService) SetArtifactoryDetails(rt auth.ArtifactoryDetails)

func (*ReadFileService) SetDryRun

func (ds *ReadFileService) SetDryRun(isDryRun bool)

type SearchParams

type SearchParams struct {
	*utils.ArtifactoryCommonParams
}

func NewSearchParams

func NewSearchParams() SearchParams

func (*SearchParams) GetFile

type SearchService

type SearchService struct {
	ArtDetails auth.ArtifactoryDetails
	// contains filtered or unexported fields
}

func NewSearchService

func NewSearchService(client *rthttpclient.ArtifactoryHttpClient) *SearchService

func (*SearchService) GetArtifactoryDetails

func (s *SearchService) GetArtifactoryDetails() auth.ArtifactoryDetails

func (*SearchService) GetJfrogHttpClient

func (s *SearchService) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)

func (*SearchService) IsDryRun

func (s *SearchService) IsDryRun() bool

func (*SearchService) Search

func (s *SearchService) Search(searchParams SearchParams) ([]utils.ResultItem, error)

func (*SearchService) SetArtifactoryDetails

func (s *SearchService) SetArtifactoryDetails(rt auth.ArtifactoryDetails)

type UploadData

type UploadData struct {
	Artifact clientutils.Artifact
	Props    string
	IsDir    bool
}

type UploadParams

type UploadParams struct {
	*utils.ArtifactoryCommonParams
	Deb               string
	Symlink           bool
	ExplodeArchive    bool
	Flat              bool
	AddVcsProps       bool
	Retries           int
	MinChecksumDeploy int64
}

func NewUploadParams

func NewUploadParams() UploadParams

func (*UploadParams) GetDebian

func (up *UploadParams) GetDebian() string

func (*UploadParams) GetRetries

func (up *UploadParams) GetRetries() int

func (*UploadParams) IsAddVcsProps added in v0.6.4

func (up *UploadParams) IsAddVcsProps() bool

func (*UploadParams) IsExplodeArchive

func (up *UploadParams) IsExplodeArchive() bool

func (*UploadParams) IsFlat

func (up *UploadParams) IsFlat() bool
func (up *UploadParams) IsSymlink() bool

type UploadService

type UploadService struct {
	Progress   ioutils.Progress
	ArtDetails auth.ArtifactoryDetails
	DryRun     bool
	Threads    int
	// contains filtered or unexported fields
}

func NewUploadService

func NewUploadService(client *rthttpclient.ArtifactoryHttpClient) *UploadService

func (*UploadService) GetJfrogHttpClient

func (us *UploadService) GetJfrogHttpClient() *rthttpclient.ArtifactoryHttpClient

func (*UploadService) SetArtDetails

func (us *UploadService) SetArtDetails(artDetails auth.ArtifactoryDetails)

func (*UploadService) SetDryRun

func (us *UploadService) SetDryRun(isDryRun bool)

func (*UploadService) SetThreads

func (us *UploadService) SetThreads(threads int)

func (*UploadService) UploadFiles

func (us *UploadService) UploadFiles(uploadParams ...UploadParams) (artifactsFileInfo []utils.FileInfo, totalUploaded, totalFailed int, err error)

type XrayScanBody

type XrayScanBody struct {
	BuildName   string `json:"buildName,omitempty"`
	BuildNumber string `json:"buildNumber,omitempty"`
	Context     string `json:"context,omitempty"`
}

type XrayScanParams

type XrayScanParams struct {
	BuildName   string
	BuildNumber string
}

func NewXrayScanParams

func NewXrayScanParams() XrayScanParams

func (*XrayScanParams) GetBuildName

func (bp *XrayScanParams) GetBuildName() string

func (*XrayScanParams) GetBuildNumber

func (bp *XrayScanParams) GetBuildNumber() string

type XrayScanService

type XrayScanService struct {
	ArtDetails auth.ArtifactoryDetails
	// contains filtered or unexported fields
}

func (*XrayScanService) ScanBuild

func (ps *XrayScanService) ScanBuild(scanParams XrayScanParams) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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