grpcplugins

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: BSD-3-Clause Imports: 30 Imported by: 8

Documentation

Index

Constants

View Source
const (
	WarnColor    = "\033[1;33m"
	ErrColor     = "\033[1;31m"
	SuccessColor = "\033[1;32m"
	NoColor      = "\033[0m"
)

Variables

This section is empty.

Functions

func BodyToFile added in v0.55.0

func BodyToFile(resp *http.Response, workDirs sdk.WorkerDirectories, path string, name string, mode fs.FileMode) (string, int64, error)

func BuildCacheURL added in v0.55.0

func BuildCacheURL(integ sdk.JobIntegrationsContext, projKey string, cacheKey string) string

func CDNItemUpload added in v0.53.1

func CDNItemUpload(ctx context.Context, c *actionplugin.Common, cdnAddr string, signature string, reader io.ReadSeeker) (*sdk.CDNItem, time.Duration, error)

func ComputeRunResultDebianDetail added in v0.55.0

func ComputeRunResultDebianDetail(name string, size int64, md5, sha1, sha256 string, components, distributions, architectures []string) sdk.V2WorkflowRunResultDetail

func ComputeRunResultDockerDetail added in v0.55.0

func ComputeRunResultDockerDetail(name string, img Img) sdk.V2WorkflowRunResultDetail

func ComputeRunResultHelmDetail added in v0.55.0

func ComputeRunResultHelmDetail(chartName, appVersion, chartVersion string) sdk.V2WorkflowRunResultDetail

func ComputeRunResultPythonDetail added in v0.55.0

func ComputeRunResultPythonDetail(packageName string, version string, extension string) sdk.V2WorkflowRunResultDetail

func ComputeRunResultTestsDetail added in v0.55.0

func ComputeRunResultTestsDetail(c *actionplugin.Common, filePath string, fileContent []byte, size int64, md5, sha1, sha256 string) (*sdk.V2WorkflowRunResultDetail, int, error)

func CreateOutput added in v0.55.0

func DownloadFromArtifactory added in v0.55.0

func DownloadFromArtifactory(ctx context.Context, c *actionplugin.Common, integration sdk.JobIntegrationsContext, workDirs sdk.WorkerDirectories, path string, name string, mode fs.FileMode, downloadURI string) (string, int64, error)

func DownloadFromCDN added in v0.55.0

func DownloadFromCDN(ctx context.Context, c *actionplugin.Common, CDNSignature string, workDirs sdk.WorkerDirectories, apirefHash, cdnType, cdnAdresse, path string, name string, mode fs.FileMode) (string, int64, error)

func Error added in v0.53.1

func Error(c *actionplugin.Common, s string)

func Errorf added in v0.53.1

func Errorf(c *actionplugin.Common, s string, i ...any)

func ExtractFileInfoIntoRunResult added in v0.53.1

func ExtractFileInfoIntoRunResult(runResult *sdk.V2WorkflowRunResult, fi ArtifactoryFileInfo, name string, resultType sdk.V2WorkflowRunResultType, localRepository, repository, maturity string)

func GetArtifactoryFileProperties added in v0.55.0

func GetArtifactoryFileProperties(ctx context.Context, c *actionplugin.Common, config ArtifactoryConfig, repo, path string) (map[string][]string, error)

func GetArtifactoryRunResults added in v0.53.1

func GetArtifactoryRunResults(ctx context.Context, c *actionplugin.Common, pattern string) (*workerruntime.V2GetResultResponse, error)

func GetJobContext added in v0.53.1

func GetJobRun added in v0.53.1

func GetProjectKey added in v0.55.0

func GetProjectKey(ctx context.Context, c *actionplugin.Common, keyName string) (*sdk.ProjectKey, error)

func GetRunResults

func GetRunResults(workerHTTPPort int32) ([]sdk.WorkflowRunResult, error)
func GetV2CacheLink(ctx context.Context, c *actionplugin.Common, cacheKey string) (*sdk.CDNItemLinks, error)

func GetV2CacheSignature added in v0.55.0

func GetV2CacheSignature(ctx context.Context, c *actionplugin.Common, cacheKey string) (*workerruntime.CDNSignature, error)

func GetWorkerConfig added in v0.55.0

func GetWorkerDirectories added in v0.53.0

func GetWorkerDirectories(ctx context.Context, c *actionplugin.Common) (*sdk.WorkerDirectories, error)

func InstallSSHKey added in v0.55.0

func InstallSSHKey(ctx context.Context, actPlug *actionplugin.Common, workDirs *sdk.WorkerDirectories, keyName, sshFilePath, privateKey string) (string, error)

func Log added in v0.53.1

func Log(c *actionplugin.Common, s string)

func Logf added in v0.53.1

func Logf(c *actionplugin.Common, s string, i ...any)

func PerformGetCache added in v0.55.0

func PerformGetCache(ctx context.Context, c *actionplugin.Common, jobCtx sdk.WorkflowRunJobsContext, cacheKey string, workDirs *sdk.WorkerDirectories, path string, failOnMiss bool) error

func RetrieveFilesToUpload added in v0.53.1

func RetrieveFilesToUpload(ctx context.Context, c *actionplugin.Common, cwd, filePath string, ifNoFilesFound string) (*glob.FileResults, map[string]int64, map[string]os.FileMode, map[string]fs.File, map[string]ChecksumResult, error)

func RunResultsSynchronize added in v0.55.0

func RunResultsSynchronize(ctx context.Context, c *actionplugin.Common) error

func RunScript added in v0.53.1

func RunScript(ctx context.Context, actPlug *actionplugin.Common, chanRes chan *actionplugin.ActionResult, workingDir string, content string) error

func Success added in v0.53.1

func Success(c *actionplugin.Common, s string)

func Successf added in v0.53.1

func Successf(c *actionplugin.Common, s string, i ...any)

func Untar added in v0.55.1

func Untar(dst string, filePath string) error

func UploadRunResult added in v0.53.1

func UploadRunResult(ctx context.Context, actplugin *actionplugin.Common, jobContext sdk.WorkflowRunJobsContext, runresultReq *workerruntime.V2RunResultRequest, fileName string, f fs.File, size int64, fileChecksum ChecksumResult) (*workerruntime.V2UpdateResultResponse, error)

func Warn added in v0.53.1

func Warn(c *actionplugin.Common, s string)

func Warnf added in v0.53.1

func Warnf(c *actionplugin.Common, s string, i ...any)

Types

type ArtifactoryConfig added in v0.53.1

type ArtifactoryConfig struct {
	URL             string
	Token           string
	DistributionURL string
	ReleaseToken    string
}

type ArtifactoryFileInfo added in v0.53.1

type ArtifactoryFileInfo struct {
	Repo        string    `json:"repo"`
	Path        string    `json:"path"`
	Created     time.Time `json:"created"`
	CreatedBy   string    `json:"createdBy"`
	DownloadURI string    `json:"downloadUri"`
	MimeType    string    `json:"mimeType"`
	Size        string    `json:"size"`
	Checksums   struct {
		Sha1   string `json:"sha1"`
		Md5    string `json:"md5"`
		Sha256 string `json:"sha256"`
	} `json:"checksums"`
	OriginalChecksums struct {
		Sha1   string `json:"sha1"`
		Md5    string `json:"md5"`
		Sha256 string `json:"sha256"`
	} `json:"originalChecksums"`
	URI string `json:"uri"`
}

func GetArtifactoryFileInfo added in v0.53.1

func GetArtifactoryFileInfo(ctx context.Context, c *actionplugin.Common, config ArtifactoryConfig, repo, path string) (*ArtifactoryFileInfo, error)

type ArtifactoryFilePropertiesResponse added in v0.55.0

type ArtifactoryFilePropertiesResponse struct {
	Properties map[string][]string `properties`
}

type ArtifactoryFolderInfo added in v0.53.1

type ArtifactoryFolderInfo struct {
	Repo      string    `json:"repo"`
	Path      string    `json:"path"`
	Created   time.Time `json:"created"`
	CreatedBy string    `json:"createdBy"`
	URI       string    `json:"uri"`
	Children  []struct {
		URI    string `json:"uri"`
		Folder bool   `json:"folder"`
	} `json:"children"`
}

func GetArtifactoryFolderInfo added in v0.53.1

func GetArtifactoryFolderInfo(ctx context.Context, c *actionplugin.Common, config ArtifactoryConfig, repo, path string) (*ArtifactoryFolderInfo, error)

type ArtifactoryUploadResult added in v0.53.1

type ArtifactoryUploadResult struct {
	Repo        string    `json:"repo"`
	Path        string    `json:"path"`
	Created     time.Time `json:"created"`
	CreatedBy   string    `json:"createdBy"`
	DownloadURI string    `json:"downloadUri"`
	MimeType    string    `json:"mimeType"`
	Size        string    `json:"size"`
	Checksums   struct {
		Sha1   string `json:"sha1"`
		Md5    string `json:"md5"`
		Sha256 string `json:"sha256"`
	} `json:"checksums"`
	OriginalChecksums struct {
		Sha1   string `json:"sha1"`
		Md5    string `json:"md5"`
		Sha256 string `json:"sha256"`
	} `json:"originalChecksums"`
	URI string `json:"uri"`
}

func ArtifactoryItemUpload added in v0.53.1

func ArtifactoryItemUpload(ctx context.Context, c *actionplugin.Common, integ sdk.JobIntegrationsContext, reader io.ReadSeeker, headers map[string]string, uploadURL string) (*ArtifactoryUploadResult, time.Duration, error)

func ArtifactoryItemUploadRunResult added in v0.55.0

func ArtifactoryItemUploadRunResult(ctx context.Context, c *actionplugin.Common, runResult *sdk.V2WorkflowRunResult, integ sdk.JobIntegrationsContext, reader io.ReadSeeker) (*ArtifactoryUploadResult, time.Duration, error)

type ChecksumResult added in v0.53.1

type ChecksumResult struct {
	Md5    string
	Sha1   string
	Sha256 string
}

type Img added in v0.55.0

type Img struct {
	Repository string
	Tag        string
	ImageID    string
	Created    string
	Size       string
}

type IntegrationCache added in v0.53.1

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

func NewIntegrationCache added in v0.53.1

func NewIntegrationCache() *IntegrationCache

type RepositoryInfo added in v0.55.0

type RepositoryInfo struct {
	Rclass       string   `json:"rclass"`
	PackageType  string   `json:"packageType"`
	Repositories []string `json:"repositories"`
}

func GetArtifactoryRepositoryInfo added in v0.55.0

func GetArtifactoryRepositoryInfo(ctx context.Context, c *actionplugin.Common, config ArtifactoryConfig, repo string) (*RepositoryInfo, error)

type SearchResult added in v0.55.0

type SearchResult struct {
	Repo         string   `json:"repo"`
	Path         string   `json:"path"`
	Name         string   `json:"name"`
	VirtualRepos []string `json:"virtual_repos"`
}

type SearchResultResponse added in v0.55.0

type SearchResultResponse struct {
	Results []SearchResult `json:"results"`
}

func SearchItem added in v0.55.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳