Documentation
¶
Index ¶
- Constants
- Variables
- type Argument
- type Config
- type CreatePipeline
- type CreatePipelineType
- type GitRepo
- type Job
- type JobStatus
- type Pipeline
- type PipelineRun
- type PipelineRunStatus
- type PipelineType
- type PrivateKey
- type User
- type UserPermission
- type UserRole
- type UserRoleCategory
- type UserRoleEndpoint
Constants ¶
const ( // PTypeUnknown unknown plugin type PTypeUnknown PipelineType = "unknown" // PTypeGolang golang plugin type PTypeGolang PipelineType = "golang" // PTypeJava java plugin type PTypeJava PipelineType = "java" // PTypePython python plugin type PTypePython PipelineType = "python" // PTypeCpp C++ plugin type PTypeCpp PipelineType = "cpp" // PTypeRuby ruby plugin type PTypeRuby PipelineType = "ruby" // CreatePipelineFailed status CreatePipelineFailed CreatePipelineType = "failed" // CreatePipelineRunning status CreatePipelineRunning CreatePipelineType = "running" // CreatePipelineSuccess status CreatePipelineSuccess CreatePipelineType = "success" // RunNotScheduled status RunNotScheduled PipelineRunStatus = "not scheduled" // RunScheduled status RunScheduled PipelineRunStatus = "scheduled" // RunFailed status RunFailed PipelineRunStatus = "failed" // RunSuccess status RunSuccess PipelineRunStatus = "success" // RunRunning status RunRunning PipelineRunStatus = "running" // RunCancelled status RunCancelled PipelineRunStatus = "cancelled" // JobWaitingExec status JobWaitingExec JobStatus = "waiting for execution" // JobSuccess status JobSuccess JobStatus = "success" // JobFailed status JobFailed JobStatus = "failed" // JobRunning status JobRunning JobStatus = "running" // LogsFolderName represents the Name of the logs folder in pipeline run folder LogsFolderName = "logs" // LogsFileName represents the file name of the logs output LogsFileName = "output.log" // APIVersion represents the current API version APIVersion = "v1" // TmpFolder is the temp folder for temporary files TmpFolder = "tmp" // TmpPythonFolder is the name of the python temporary folder TmpPythonFolder = "python" // TmpGoFolder is the name of the golang temporary folder TmpGoFolder = "golang" // TmpCppFolder is the name of the c++ temporary folder TmpCppFolder = "cpp" // TmpRubyFolder is the name of the ruby temporary folder TmpRubyFolder = "ruby" )
Variables ¶
var Cfg = &Config{}
Cfg represents the global config instance
Functions ¶
This section is empty.
Types ¶
type Argument ¶ added in v0.2.1
type Argument struct {
Description string `json:"desc,omitempty"`
Type string `json:"type,omitempty"`
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
}
Argument represents a single argument of a job
type Config ¶
type Config struct {
DevMode bool
VersionSwitch bool
Poll bool
PVal int
ListenPort string
HomePath string
Hostname string
VaultPath string
DataPath string
PipelinePath string
WorkspacePath string
Worker string
JwtPrivateKeyPath string
JWTKey interface{}
Logger hclog.Logger
CAPath string
Bolt struct {
Mode os.FileMode
}
}
Config holds all config options
type CreatePipeline ¶
type CreatePipeline struct {
ID string `json:"id,omitempty"`
Pipeline Pipeline `json:"pipeline,omitempty"`
Status int `json:"status,omitempty"`
StatusType CreatePipelineType `json:"statustype,omitempty"`
Output string `json:"output,omitempty"`
Created time.Time `json:"created,omitempty"`
GitHubToken string `json:"githubtoken,omitempty"`
}
CreatePipeline represents a pipeline which is not yet compiled.
type CreatePipelineType ¶
type CreatePipelineType string
CreatePipelineType represents the different status types a create pipeline can have.
type GitRepo ¶
type GitRepo struct {
URL string `json:"url,omitempty"`
Username string `json:"user,omitempty"`
Password string `json:"password,omitempty"`
PrivateKey PrivateKey `json:"privatekey,omitempty"`
SelectedBranch string `json:"selectedbranch,omitempty"`
Branches []string `json:"branches,omitempty"`
LocalDest string `json:"-"`
}
GitRepo represents a single git repository
type Job ¶
type Job struct {
ID uint32 `json:"id,omitempty"`
Title string `json:"title,omitempty"`
Description string `json:"desc,omitempty"`
DependsOn []*Job `json:"dependson,omitempty"`
Status JobStatus `json:"status,omitempty"`
Args []Argument `json:"args,omitempty"`
FailPipeline bool `json:"failpipeline,omitempty"`
}
Job represents a single job of a pipeline
type Pipeline ¶
type Pipeline struct {
ID int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Repo GitRepo `json:"repo,omitempty"`
Type PipelineType `json:"type,omitempty"`
ExecPath string `json:"execpath,omitempty"`
SHA256Sum []byte `json:"sha256sum,omitempty"`
Jobs []Job `json:"jobs,omitempty"`
Created time.Time `json:"created,omitempty"`
UUID string `json:"uuid,omitempty"`
IsNotValid bool `json:"notvalid,omitempty"`
PeriodicSchedules []string `json:"periodicschedules,omitempty"`
TriggerToken string `json:"trigger_token,omitempty"`
CronInst *cron.Cron `json:"-"`
}
Pipeline represents a single pipeline
type PipelineRun ¶
type PipelineRun struct {
UniqueID string `json:"uniqueid"`
ID int `json:"id"`
PipelineID int `json:"pipelineid"`
StartDate time.Time `json:"startdate,omitempty"`
FinishDate time.Time `json:"finishdate,omitempty"`
ScheduleDate time.Time `json:"scheduledate,omitempty"`
Status PipelineRunStatus `json:"status,omitempty"`
Jobs []Job `json:"jobs,omitempty"`
}
PipelineRun represents a single run of a pipeline.
type PipelineRunStatus ¶
type PipelineRunStatus string
PipelineRunStatus represents the different status a run can have.
type PipelineType ¶
type PipelineType string
PipelineType represents supported plugin types
func (PipelineType) String ¶
func (p PipelineType) String() string
String returns a pipeline type string back
type PrivateKey ¶
type PrivateKey struct {
Key string `json:"key,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
PrivateKey represents a pem encoded private key
type User ¶
type User struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
DisplayName string `json:"display_name,omitempty"`
Tokenstring string `json:"tokenstring,omitempty"`
JwtExpiry int64 `json:"jwtexpiry,omitempty"`
LastLogin time.Time `json:"lastlogin,omitempty"`
TriggerToken string `json:"trigger_token,omitempty"`
}
User is the user object
type UserPermission ¶ added in v0.2.3
type UserPermission struct {
Username string `json:"username"`
Roles []string `json:"roles"`
Groups []string `json:"groups"`
}
UserPermission is stored in its own data structure away from the core user. It represents all permission data for a single user.
type UserRole ¶ added in v0.2.3
type UserRole struct {
Name string `json:"name"`
Description string `json:"description"`
APIEndpoint []*UserRoleEndpoint `json:"api_endpoints"`
}
UserRole represents a single permission role.
type UserRoleCategory ¶ added in v0.2.3
type UserRoleCategory struct {
Name string `json:"name"`
Description string `json:"description"`
Roles []*UserRole `json:"roles"`
}
UserRoleCategory represents the top-level of the permission role system
type UserRoleEndpoint ¶ added in v0.2.3
UserRoleEndpoint represents the path and method of the API endpoint to be secured.