Documentation ¶
Index ¶
- Variables
- func JoinPath(elem ...string) string
- func OverwriteFromEnv(data interface{})
- type APIError
- type Action
- type ActionArtifact
- type ArtifactDownloadByteArrayRequest
- type ArtifactDownloadRequest
- type ArtifactListRequest
- type ArtifactUploadRequest
- type CurrentConfig
- type ExecuteCommandRequest
- type ExecuteCommandResponse
- type File
- type FileRequest
- type HealthcheckResponse
- type LogMessageRequest
- type ModuleActionData
- type ProjectActionData
- type ProjectBuildSystem
- type ProjectBuildSystemSyntax
- type ProjectDependency
- type ProjectLanguage
- type ProjectModule
- type ProjectModuleDiscovery
- type SDK
- func (sdk SDK) ArtifactDownload(request ArtifactDownloadRequest) error
- func (sdk SDK) ArtifactDownloadByteArray(request ArtifactDownloadByteArrayRequest) ([]byte, error)
- func (sdk SDK) ArtifactList(request ArtifactListRequest) (*[]ActionArtifact, error)
- func (sdk SDK) ArtifactUpload(request ArtifactUploadRequest) error
- func (sdk SDK) CurrentConfig() (*CurrentConfig, error)
- func (sdk SDK) CurrentModule() (*ProjectModule, error)
- func (sdk SDK) Env() (map[string]string, error)
- func (sdk SDK) ExecuteCommand(req ExecuteCommandRequest) (*ExecuteCommandResponse, error)
- func (sdk SDK) FileCopy(old string, new string) error
- func (sdk SDK) FileExists(file string) bool
- func (sdk SDK) FileList(req FileRequest) (files []File, err error)
- func (sdk SDK) FileRead(file string) (string, error)
- func (sdk SDK) FileRemove(file string) error
- func (sdk SDK) FileRename(old string, new string) error
- func (sdk SDK) FileWrite(file string, content []byte) error
- func (sdk SDK) Health() (*HealthcheckResponse, error)
- func (sdk SDK) Log(req LogMessageRequest) error
- func (sdk SDK) ModuleAction(cfg any) (ModuleActionData, error)
- func (sdk SDK) Modules() (*[]ProjectModule, error)
- func (sdk SDK) ProjectAction(cfg any) (ProjectActionData, error)
- func (sdk SDK) TARCreate(inputDirectory string, outputFile string) error
- func (sdk SDK) TARExtract(archiveFile string, outputDirectory string) error
- func (sdk SDK) UUID() string
- func (sdk SDK) VCSCommitByHash(request VCSCommitByHashRequest) (*VCSCommit, error)
- func (sdk SDK) VCSCommits(request VCSCommitsRequest) (*[]VCSCommit, error)
- func (sdk SDK) VCSDiff(request VCSDiffRequest) (*[]VCSDiff, error)
- func (sdk SDK) VCSReleases(request VCSReleasesRequest) (*[]VCSRelease, error)
- func (sdk SDK) VCSTags() (*[]VCSTag, error)
- func (sdk SDK) ZIPCreate(inputDirectory string, outputFile string) error
- func (sdk SDK) ZIPExtract(archiveFile string, outputDirectory string) error
- type SDKClient
- type SpecificationType
- type VCSAuthor
- type VCSChange
- type VCSCommit
- type VCSCommitByHashRequest
- type VCSCommitsRequest
- type VCSDiff
- type VCSDiffLine
- type VCSDiffRequest
- type VCSFile
- type VCSRelease
- type VCSReleasesRequest
- type VCSTag
Constants ¶
This section is empty.
Variables ¶
var JoinSeparator = ""
Functions ¶
func OverwriteFromEnv ¶
func OverwriteFromEnv(data interface{})
OverwriteFromEnv will overwrite values with the given env values if present
Types ¶
type APIError ¶
type APIError struct { Detail string `json:"detail,omitempty"` Status int `json:"status,omitempty"` Title string `json:"title,omitempty"` }
APIError defines model for Error.
type Action ¶
type Action interface {
Execute() error
}
Action is the common interface for all actions
type ActionArtifact ¶
type ActionArtifact struct { BuildID string `json:"build_id,omitempty"` JobID string `json:"job_id,omitempty"` ID string `json:"id,omitempty"` Module string `json:"module,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Format string `json:"format,omitempty"` FormatVersion string `json:"format_version,omitempty"` }
ActionArtifact contains information about generated artifacts
type ArtifactDownloadByteArrayRequest ¶
type ArtifactDownloadByteArrayRequest struct {
ID string `json:"id"`
}
type ArtifactDownloadRequest ¶
type ArtifactListRequest ¶
type ArtifactListRequest struct {
Query string `json:"query"`
}
type ArtifactUploadRequest ¶
type ArtifactUploadRequest struct { File string `json:"file"` Content string `json:"content"` ContentBytes []byte `json:"content_bytes"` Module string `json:"module"` Type string `json:"type"` Format string `json:"format"` FormatVersion string `json:"format_version"` ExtractFile bool `json:"extract_file"` }
type CurrentConfig ¶
type CurrentConfig struct { Debug bool `json:"debug,omitempty"` Log map[string]string `json:"log,omitempty"` ProjectDir string `json:"project_dir,omitempty"` TempDir string `json:"temp_dir,omitempty"` ArtifactDir string `json:"artifact_dir,omitempty"` HostName string `json:"host_name,omitempty"` HostUserId string `json:"host_user_id,omitempty"` HostUserName string `json:"host_user_name,omitempty"` HostGroupId string `json:"host_group_id,omitempty"` Config string `json:"config,omitempty"` }
CurrentConfig defines model for CurrentConfig.
type ExecuteCommandRequest ¶
type ExecuteCommandRequest struct { // CaptureOutput capture and return the output (stdout and stderr will be passed through if not set) CaptureOutput bool `json:"capture_output,omitempty"` // Command command Command string `json:"command,omitempty"` // WorkDir directory to execute the command in (default = project root) WorkDir string `json:"work_dir,omitempty"` // Env contains additional env properties Env map[string]string `json:"env,omitempty"` // Ports that will be exposed Ports []int `json:"ports,omitempty"` // A version Constraint for the binary used in command Constraint []int `json:"constraint,omitempty"` }
ExecuteCommandRequest defines model for ExecuteCommandRequest.
type ExecuteCommandResponse ¶
type ExecuteCommandResponse struct { // Code command exit code Code int `json:"code,omitempty"` // Command the command being executed Command string `json:"command,omitempty"` // Dir directory the command is executed in Dir string `json:"dir,omitempty"` // Error error message Error string `json:"error,omitempty"` // Stderr error output (if capture-output was request, empty otherwise) Stderr string `json:"stderr,omitempty"` // Stdout standard output (if capture-output was request, empty otherwise) Stdout string `json:"stdout,omitempty"` }
ExecuteCommandResponse defines model for ExecuteCommandResponse.
type File ¶
type FileRequest ¶
type HealthcheckResponse ¶
type HealthcheckResponse struct {
Status string `json:"status"`
}
HealthcheckResponse defines model for HealthcheckResponse.
type LogMessageRequest ¶
type ModuleActionData ¶
type ModuleActionData struct { ProjectDir string Module ProjectModule Config CurrentConfig Env map[string]string }
type ProjectActionData ¶
type ProjectActionData struct { ProjectDir string Config CurrentConfig Modules []ProjectModule Env map[string]string }
type ProjectBuildSystem ¶
type ProjectBuildSystem string
const ( BuildSystemDefault ProjectBuildSystem = "default" BuildSystemGradle ProjectBuildSystem = "gradle" BuildSystemMaven ProjectBuildSystem = "maven" BuildSystemGoMod ProjectBuildSystem = "gomod" BuildSystemNpm ProjectBuildSystem = "npm" BuildSystemHugo ProjectBuildSystem = "hugo" BuildSystemHelm ProjectBuildSystem = "helm" BuildSystemHelmfile ProjectBuildSystem = "helmfile" BuildSystemContainer ProjectBuildSystem = "container" BuildSystemRequirementsTXT ProjectBuildSystem = "python-requirements.txt" BuildSystemPipfile ProjectBuildSystem = "pipfile" BuildSystemSetupPy ProjectBuildSystem = "setup.py" BuildSystemPoetry ProjectBuildSystem = "poetry" BuildSystemMkdocs ProjectBuildSystem = "mkdocs" BuildSystemComposer ProjectBuildSystem = "composer" BuildSystemDotNet ProjectBuildSystem = "dotnet" BuildSystemCargo ProjectBuildSystem = "cargo" BuildSystemNix ProjectBuildSystem = "nix" BuildSystemAnsible ProjectBuildSystem = "ansible" )
type ProjectBuildSystemSyntax ¶
type ProjectBuildSystemSyntax string
const ( BuildSystemSyntaxDefault ProjectBuildSystemSyntax = "default" BuildSystemSyntaxGradleGroovyDSL ProjectBuildSystemSyntax = "groovy" BuildSystemSyntaxGradleKotlinDSL ProjectBuildSystemSyntax = "kotlin" BuildSystemSyntaxDotNetSLN ProjectBuildSystemSyntax = "sln" BuildSystemSyntaxDotNetSLNX ProjectBuildSystemSyntax = "slnx" BuildSystemSyntaxDotNetCSProj ProjectBuildSystemSyntax = "csproj" BuildSystemSyntaxContainerFile ProjectBuildSystemSyntax = "containerfile" BuildSystemSyntaxContainerBuildahScript ProjectBuildSystemSyntax = "buildah-script" BuildSystemSyntaxMkdocsTechdocs ProjectBuildSystemSyntax = "mkdocs-techdocs" BuildSystemSyntaxNixFlake ProjectBuildSystemSyntax = "flake" )
type ProjectDependency ¶
type ProjectDependency struct { Id string `json:"id,omitempty"` Type string `json:"type,omitempty"` Version string `json:"version,omitempty"` }
ProjectDependency defines model for ProjectDependency.
type ProjectLanguage ¶
type ProjectLanguage string
const ( LanguageGolang ProjectLanguage = "go" LanguageJava ProjectLanguage = "java" LanguageKotlin ProjectLanguage = "kotlin" LanguageJavascript ProjectLanguage = "javascript" LanguageTypescript ProjectLanguage = "typescript" LanguagePython ProjectLanguage = "python" LanguagePHP ProjectLanguage = "php" LanguageRust ProjectLanguage = "rust" LanguageNix ProjectLanguage = "nix" LanguageOpenAPI ProjectLanguage = "openapi" LanguageAsyncAPI ProjectLanguage = "asyncapi" )
type ProjectModule ¶
type ProjectModule struct { // ProjectDir project root directory ProjectDir string `json:"project_dir,omitempty"` // ModuleDir module root directory ModuleDir string `json:"module_dir,omitempty"` // Discovery module detected based on Discovery []ProjectModuleDiscovery `json:"discovery,omitempty"` // Name module name Name string `json:"name,omitempty"` // Slug module name Slug string `json:"slug,omitempty"` // Type is the module type Type string `json:"type,omitempty"` // BuildSystem module name BuildSystem string `json:"build_system,omitempty"` // BuildSystemSyntax module name BuildSystemSyntax string `json:"build_system_syntax,omitempty"` // SpecificationType is the type of the specification SpecificationType string `json:"specification_type,omitempty"` // Language module name Language *map[string]string `json:"language,omitempty"` // Dependencies module name Dependencies *[]ProjectDependency `json:"dependencies,omitempty"` // Files all files in the project directory Files []string `json:"files,omitempty"` // Submodules submodules Submodules *[]ProjectModule `json:"submodules,omitempty"` }
ProjectModule defines model for ProjectModule.
type ProjectModuleDiscovery ¶
type ProjectModuleDiscovery struct {
File string `json:"file"`
}
ProjectModuleDiscovery contains info on the files used to discover the module
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
func (SDK) ArtifactDownload ¶
func (sdk SDK) ArtifactDownload(request ArtifactDownloadRequest) error
ArtifactDownload request
func (SDK) ArtifactDownloadByteArray ¶
func (sdk SDK) ArtifactDownloadByteArray(request ArtifactDownloadByteArrayRequest) ([]byte, error)
ArtifactDownloadByteArray request
func (SDK) ArtifactList ¶
func (sdk SDK) ArtifactList(request ArtifactListRequest) (*[]ActionArtifact, error)
ArtifactList request
func (SDK) ArtifactUpload ¶
func (sdk SDK) ArtifactUpload(request ArtifactUploadRequest) error
ArtifactUpload request
func (SDK) CurrentConfig ¶
func (sdk SDK) CurrentConfig() (*CurrentConfig, error)
CurrentConfig request
func (SDK) CurrentModule ¶
func (sdk SDK) CurrentModule() (*ProjectModule, error)
CurrentModule request
func (SDK) ExecuteCommand ¶
func (sdk SDK) ExecuteCommand(req ExecuteCommandRequest) (*ExecuteCommandResponse, error)
ExecuteCommand command
func (SDK) FileList ¶
func (sdk SDK) FileList(req FileRequest) (files []File, err error)
FileList command
func (SDK) ModuleAction ¶
func (sdk SDK) ModuleAction(cfg any) (ModuleActionData, error)
ModuleAction is a utility function to prepare to run a module-scoped action
func (SDK) ProjectAction ¶
func (sdk SDK) ProjectAction(cfg any) (ProjectActionData, error)
ProjectAction is a utility function to prepare to run a project-scoped action
func (SDK) TARExtract ¶
TARExtract extracts a tar archive at the given path into the given directory.
func (SDK) VCSCommitByHash ¶
func (sdk SDK) VCSCommitByHash(request VCSCommitByHashRequest) (*VCSCommit, error)
VCSCommitByHash request
func (SDK) VCSCommits ¶
func (sdk SDK) VCSCommits(request VCSCommitsRequest) (*[]VCSCommit, error)
VCSCommits request
func (SDK) VCSDiff ¶
func (sdk SDK) VCSDiff(request VCSDiffRequest) (*[]VCSDiff, error)
VCSDiff request
func (SDK) VCSReleases ¶
func (sdk SDK) VCSReleases(request VCSReleasesRequest) (*[]VCSRelease, error)
VCSReleases request
type SDKClient ¶
type SDKClient interface { Health() (*HealthcheckResponse, error) Log(req LogMessageRequest) error ModuleAction(cfg any) (ModuleActionData, error) ProjectAction(cfg any) (ProjectActionData, error) Env() (map[string]string, error) Modules() (*[]ProjectModule, error) CurrentModule() (*ProjectModule, error) CurrentConfig() (*CurrentConfig, error) VCSCommits(request VCSCommitsRequest) (*[]VCSCommit, error) VCSCommitByHash(request VCSCommitByHashRequest) (*VCSCommit, error) VCSTags() (*[]VCSTag, error) VCSReleases(request VCSReleasesRequest) (*[]VCSRelease, error) VCSDiff(request VCSDiffRequest) (*[]VCSDiff, error) ExecuteCommand(req ExecuteCommandRequest) (*ExecuteCommandResponse, error) FileRead(file string) (string, error) FileList(req FileRequest) (files []File, err error) FileRename(old string, new string) error FileRemove(file string) error FileWrite(file string, content []byte) error FileExists(file string) bool ZIPCreate(inputDirectory string, archiveFile string) error ZIPExtract(archiveFile string, outputDirectory string) error TARCreate(inputDirectory string, archiveFile string) error TARExtract(archiveFile string, outputDirectory string) error ArtifactList(request ArtifactListRequest) (*[]ActionArtifact, error) ArtifactUpload(request ArtifactUploadRequest) error ArtifactDownload(request ArtifactDownloadRequest) error ArtifactDownloadByteArray(request ArtifactDownloadByteArrayRequest) ([]byte, error) UUID() string }
type SpecificationType ¶
type SpecificationType string
const ( SpecificationTypeOpenAPI SpecificationType = "openapi" SpecificationTypeAsyncAPI SpecificationType = "asyncapi" SpecificationTypeRenovate SpecificationType = "renovate" )
type VCSCommit ¶
type VCSCommit struct { HashShort string `json:"hash_short,omitempty"` Hash string `json:"hash,omitempty"` Message string `json:"message,omitempty"` Description string `json:"description,omitempty"` Author VCSAuthor `json:"author,omitempty"` Committer VCSAuthor `json:"committer,omitempty"` Tags *[]VCSTag `json:"tags,omitempty"` AuthoredAt time.Time `json:"authored_at,omitempty"` CommittedAt time.Time `json:"committed_at,omitempty"` Changes *[]VCSChange `json:"changes,omitempty"` Context map[string]string `json:"context,omitempty"` }
type VCSCommitByHashRequest ¶
type VCSCommitsRequest ¶
type VCSDiff ¶
type VCSDiff struct { FileFrom VCSFile `json:"file_from"` FileTo VCSFile `json:"file_to"` Lines []VCSDiffLine `json:"lines,omitempty"` }
type VCSDiffLine ¶
type VCSDiffRequest ¶
type VCSRelease ¶
type VCSReleasesRequest ¶
type VCSReleasesRequest struct {
Type string `json:"type"` // Type of the release: stable, unstable
}