service

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const GIT_ACCOUNT_TYPE = "gitaccount"
View Source
const REPO_CACHE_TYPE = "repocache"

Variables

View Source
var ErrInvalidPipeline = errors.New("Invalid Pipeline definition")

Functions

func ApproveActivity

func ApproveActivity(provider model.PipelineProvider, activity *model.Activity) error

func CleanAccounts

func CleanAccounts(scmType string) ([]*model.GitAccount, error)

func CleanPipeline

func CleanPipeline(p *model.Pipeline)

func CreateAccount

func CreateAccount(account *model.GitAccount) error

func CreateActivity

func CreateActivity(activity *model.Activity) error

func CreateCredential

func CreateCredential(cred *model.Credential) error

func CreateOrUpdateCacheRepoList

func CreateOrUpdateCacheRepoList(accountId string, repos []*model.GitRepository) error

func CreateOrUpdateEnvKey

func CreateOrUpdateEnvKey(clientId string, token string) error

func CreateOrUpdatePipelineSetting

func CreateOrUpdatePipelineSetting(setting *model.PipelineSetting) error

func CreateOrUpdateSCMSetting

func CreateOrUpdateSCMSetting(setting *model.SCMSetting) error

func CreatePipeline

func CreatePipeline(pipeline *model.Pipeline) error

func DeleteActivity

func DeleteActivity(id string) error

func DeletePipeline

func DeletePipeline(id string) (*model.Pipeline, error)

func DenyActivity

func DenyActivity(activity *model.Activity) error

func FailStep

func FailStep(activity *model.Activity, stageOrdinal int, stepOrdinal int)

func GetAccount

func GetAccount(id string) (*model.GitAccount, error)

func GetActivity

func GetActivity(id string) (*model.Activity, error)

Get Activity From GenericObjects By Id

func GetAllServices

func GetAllServices(activity *model.Activity) []*model.CIService

GetAllServices gets all run services of the activity

func GetCacheRepoList

func GetCacheRepoList(accountId string) ([]*model.GitRepository, error)

func GetEnvKey

func GetEnvKey(clientId string) (string, error)

func GetNextRunTime

func GetNextRunTime(pipeline *model.Pipeline) int64

func GetPipelineById

func GetPipelineById(id string) (*model.Pipeline, error)

func GetPipelineSetting

func GetPipelineSetting() (*model.PipelineSetting, error)

func GetSCMSetting

func GetSCMSetting(scmType string) (*model.SCMSetting, error)

func GetSCManager

func GetSCManager(scmType string) (model.SCManager, error)

func GetSCManagerFromSetting

func GetSCManagerFromSetting(s *model.SCMSetting) (model.SCManager, error)

func GetSCManagerFromUserID

func GetSCManagerFromUserID(userId string) (model.SCManager, error)

func GetServices

func GetServices(activity *model.Activity, stageOrdinal int, stepOrdinal int) []*model.CIService

GetServices gets run services before the step

func GetUserToken

func GetUserToken(gitUser string) (string, error)

func HasStageCondition

func HasStageCondition(s *model.Stage) bool

func HasStepCondition

func HasStepCondition(s *model.Step) bool

func IsComplete

func IsComplete(activity *model.Activity) bool

func IsStageSuccess

func IsStageSuccess(stage *model.ActivityStage) bool

func IsValidName

func IsValidName(name string) error

IsValidName checks if name valid. limit to [a-zA-Z0-9-_]

func ListAccounts

func ListAccounts(uid string) ([]*model.GitAccount, error)

listAccounts gets scm accounts accessible by the user

func ListActivities

func ListActivities() ([]*model.Activity, error)

func ListPipelines

func ListPipelines() []*model.Pipeline

get all pipelines from GenericObject

func ListSCMSetting

func ListSCMSetting() []*model.SCMSetting

func PaginateGenericObjects

func PaginateGenericObjects(kind string) ([]client.GenericObject, error)

func RefreshRepos

func RefreshRepos(accountId string) ([]*model.GitRepository, error)

func RemoveAccount

func RemoveAccount(id string) (*model.GitAccount, error)

func RemoveSCMSetting

func RemoveSCMSetting(id string) (*model.SCMSetting, error)

func RerunActivity

func RerunActivity(provider model.PipelineProvider, activity *model.Activity) error

func Reset

func Reset() error

func ResetActivityStatus

func ResetActivityStatus(activity *model.Activity)

resetActivityStatus reset status and timestamp

func RunPipeline

func RunPipeline(provider model.PipelineProvider, id string, triggerType string) (*model.Activity, error)

func ShareAccount

func ShareAccount(id string) (*model.GitAccount, error)

func StartStep

func StartStep(activity *model.Activity, stageOrdinal int, stepOrdinal int)

func StopActivity

func StopActivity(provider model.PipelineProvider, activity *model.Activity) error

func SuccessStep

func SuccessStep(activity *model.Activity, stageOrdinal int, stepOrdinal int)

func SyncActivity

func SyncActivity(provider model.PipelineProvider, activity *model.Activity) error

get updated activity from provider

func Triggernext

func Triggernext(activity *model.Activity, stageOrdinal int, stepOrdinal int, provider model.PipelineProvider)

func UnshareAccount

func UnshareAccount(id string) (*model.GitAccount, error)

func UpdateAccount

func UpdateAccount(account *model.GitAccount) error

func UpdateActivity

func UpdateActivity(activity *model.Activity) error

func UpdateCredential

func UpdateCredential(cred *model.Credential) error

func UpdatePipeline

func UpdatePipeline(pipeline *model.Pipeline) error

func UpdatePipelineEnvKey

func UpdatePipelineEnvKey(p *model.Pipeline) error

func ValidAccountAccess

func ValidAccountAccess(req *http.Request, accountId string) bool

func ValidAccountAccessById

func ValidAccountAccessById(uid string, accountId string) bool

func Validate

func Validate(p *model.Pipeline) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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