github.com/semaphoreui/semaphore/api/projects
No package summary is available.
Package
Files: 18. Third party imports: 3. Imports from organisation: 0. Tests: 0. Benchmarks: 0.
Types
projUser
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| ID |
|
No comment on field. |
| Username |
|
No comment on field. |
| Name |
|
No comment on field. |
| Role |
|
No comment on field. |
publicAlias
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| ID |
|
No comment on field. |
| URL |
|
No comment on field. |
Functions
func AddEnvironment
AddEnvironment creates an environment in the database
Uses: context.Get, db.Environment, db.EnvironmentSecret, db.EventEnvironment, db.Project, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogCreate, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusCreated.func AddIntegration
func AddIntegrationAlias
func AddIntegrationExtractValue
func AddIntegrationMatcher
func AddInventory
AddInventory creates an inventory in the database
Uses: context.Get, db.EventInventory, db.Inventory, db.InventoryFile, db.InventoryStatic, db.InventoryStaticYaml, db.InventoryTerraformWorkspace, db.InventoryTofuWorkspace, db.Project, db.ValidateInventory, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogCreate, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusCreated.func AddKey
AddKey adds a new key to the database
Uses: context.Get, db.AccessKey, db.EventKey, db.Project, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogCreate, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusCreated.func AddProject
AddProject adds a new project to the database
Uses: context.Get, db.AccessKey, db.AccessKeyNone, db.Environment, db.EventProject, db.Project, db.ProjectOwner, db.ProjectUser, db.User, helpers.Bind, helpers.EventLog, helpers.EventLogCreate, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusCreated, http.StatusUnauthorized, log.Warn, util.Config.func AddRepository
AddRepository creates a new repository in the database
Uses: context.Get, db.EventRepository, db.Project, db.Repository, db.ValidateRepository, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogCreate, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusCreated.func AddRunner
func AddSchedule
AddSchedule adds a template to the database
Uses: context.Get, db.EventSchedule, db.Project, db.Schedule, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogCreate, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusCreated.func AddTask
AddTask inserts a task into the database and returns a header or returns error
Uses: context.Get, db.Project, db.Task, db.User, errors.Is, helpers.Bind, helpers.Store, helpers.TaskPool, helpers.WriteError, helpers.WriteErrorStatus, helpers.WriteJSON, http.StatusCreated, http.StatusForbidden, http.StatusInternalServerError, log.Fields, tasks.ErrInvalidSubscription, util.LogErrorF.func AddTemplate
AddTemplate adds a template to the database
Uses: context.Get, db.EventSchedule, db.Inventory, db.InventoryType, db.Project, db.Template, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogCreate, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteErrorStatus, helpers.WriteJSON, http.StatusBadRequest, http.StatusCreated, util.Config.func AddTerraformInventoryAlias
func AddUser
AddUser adds a user to a projects team in the database
Uses: context.Get, db.EventUser, db.Project, db.ProjectUser, db.ProjectUserRole, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogCreate, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, http.StatusBadRequest, http.StatusConflict, http.StatusNoContent.func AddView
AddView adds a new key to the database
Uses: context.Get, db.EventView, db.Project, db.View, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogCreate, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusCreated.func AttachInventory
func ClearCache
func ClearRunnerCache
func ConfirmTask
func DeleteIntegration
func DeleteIntegrationExtractValue
func DeleteIntegrationMatcher
func DeleteProject
DeleteProject removes a project from the database
Uses: context.Get, db.Project, helpers.Store, helpers.WriteError, http.StatusNoContent, log.Error, util.Config.func DeleteRunner
func DeleteTerraformInventoryAlias
func DeleteTerraformInventoryState
func DetachInventory
func EnvironmentMiddleware
EnvironmentMiddleware ensures an environment exists and loads it to the context
Uses: context.Get, context.Set, db.FillEnvironmentSecrets, db.Project, helpers.GetIntParam, helpers.Store, helpers.WriteError, http.HandlerFunc, http.Request, http.ResponseWriter, http.StatusBadRequest.func GetAllTasks
GetAllTasks returns all tasks for the current project
func GetAnsibleTaskErrors
func GetAnsibleTaskHosts
func GetBackup
func GetEnvironment
GetEnvironment retrieves sorted environments from the database
Uses: context.Get, db.Environment, db.Project, helpers.QueryParams, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusOK.func GetEnvironmentRefs
func GetIntegration
func GetIntegrationAlias
func GetIntegrationExtractValue
func GetIntegrationExtractValueRefs
func GetIntegrationExtractValues
func GetIntegrationMatcher
func GetIntegrationMatcherRefs
func GetIntegrationMatchers
func GetIntegrationRefs
func GetIntegrations
func GetInventory
GetInventory returns an inventory from the database
Uses: context.Get, db.Inventory, db.InventoryProps, db.InventoryType, db.Project, db.TemplateApp, helpers.QueryParamsWithOwner, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusOK.func GetInventoryRefs
func GetKeyRefs
func GetKeys
GetKeys retrieves sorted keys from the database
Uses: context.Get, db.AccessKey, db.Project, helpers.QueryParams, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusOK.func GetLastTasks
GetLastTasks returns the hundred most recent tasks
Uses: strconv.Atoi.func GetMustCanMiddleware
GetMustCanMiddleware ensures that the user has administrator rights
Uses: context.Get, db.ProjectUserRole, db.User, http.Handler, http.HandlerFunc, http.Request, http.ResponseWriter, http.StatusForbidden.func GetProject
GetProject returns a project details
Uses: context.Get, helpers.WriteJSON, http.StatusOK.func GetProjectSchedules
func GetProjects
GetProjects returns all projects in this users context
Uses: context.Get, db.Project, db.User, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusOK.func GetRepositories
GetRepositories returns all repositories in a project sorted by type
Uses: context.Get, db.Project, db.Repository, db.RepositoryProps, helpers.QueryParamsForProps, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusOK.func GetRepositoryBranches
func GetRepositoryRefs
func GetRunner
func GetRunnerTags
func GetRunners
func GetSchedule
GetSchedule returns single template by ID
Uses: context.Get, db.Schedule, helpers.WriteJSON, http.StatusOK.func GetTask
GetTask returns a task based on its id
Uses: context.Get, db.Task, helpers.WriteJSON, http.StatusOK.func GetTaskMiddleware
GetTaskMiddleware is middleware that gets a task by id and sets the context to it or panics
Uses: context.Get, context.Set, db.Project, helpers.GetIntParam, helpers.Store, http.HandlerFunc, http.Request, http.ResponseWriter, http.StatusBadRequest, log.Fields, util.LogErrorF.func GetTaskOutput
GetTaskOutput returns the logged task output by id and writes it as json or returns error
Uses: context.Get, db.Project, db.RetrieveQueryParams, db.Task, db.TaskOutput, helpers.Store, helpers.WriteJSON, http.StatusBadRequest, http.StatusOK, log.Fields, util.LogErrorF.func GetTaskRawOutput
func GetTaskStages
GetTaskStages returns the logged task stages by id and writes it as json or returns error
Uses: context.Get, db.Project, db.Task, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusOK, json.Unmarshal.func GetTaskStats
func GetTasksList
GetTasksList returns a list of tasks for the current project in desc order to limit or error
Uses: context.Get, db.Project, db.RetrieveQueryParams, db.TaskWithTpl, db.Template, helpers.Store, helpers.WriteJSON, http.StatusBadRequest, http.StatusOK, log.Fields, util.LogErrorF.func GetTemplate
GetTemplate returns single template by ID
Uses: context.Get, db.Template, helpers.WriteJSON, http.StatusOK.func GetTemplateRefs
func GetTemplateSchedules
func GetTemplates
GetTemplates returns all templates for a project in a sort order
Uses: context.Get, db.Project, db.TemplateApp, db.TemplateFilter, helpers.QueryParams, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusOK.func GetTerraformInventoryAlias
func GetTerraformInventoryAliases
func GetTerraformInventoryLatestState
func GetTerraformInventoryState
func GetTerraformInventoryStates
func GetUserRole
func GetUsers
GetUsers returns all users in a project
Uses: context.Get, db.Project, db.User, helpers.QueryParams, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusOK.func GetViewTemplates
func GetViews
GetViews retrieves sorted keys from the database
Uses: context.Get, db.Project, db.View, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusOK.func IntegrationMiddleware
func InventoryMiddleware
InventoryMiddleware ensures an inventory exists and loads it to the context
Uses: context.Get, context.Set, db.Project, helpers.GetIntParam, helpers.Store, helpers.WriteError, http.HandlerFunc, http.Request, http.ResponseWriter.func IsValidInventoryPath
IsValidInventoryPath tests a path to ensure it is below the cwd
Uses: filepath.Abs, filepath.Rel, os.Getwd, strings.HasPrefix.func KeyMiddleware
KeyMiddleware ensures a key exists and loads it to the context
Uses: context.Get, context.Set, db.Project, helpers.GetIntParam, helpers.Store, helpers.WriteError, http.HandlerFunc, http.Request, http.ResponseWriter.func LeftProject
LeftProject removes a user from a project team
Uses: context.Get, db.User.func ProjectMiddleware
ProjectMiddleware ensures a project exists and loads it to the context
Uses: context.Get, context.Set, db.User, helpers.GetIntParam, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.HandlerFunc, http.Request, http.ResponseWriter, http.StatusBadRequest.func RejectTask
func RemoveEnvironment
RemoveEnvironment deletes an environment from the database
Uses: context.Get, db.Environment, db.ErrInvalidOperation, db.EventEnvironment, fmt.Sprintf, helpers.EventLog, helpers.EventLogDelete, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent.func RemoveIntegrationAlias
func RemoveInventory
RemoveInventory deletes an inventory from the database
Uses: context.Get, db.ErrInvalidOperation, db.EventInventory, db.Inventory, errors.Is, fmt.Sprintf, helpers.EventLog, helpers.EventLogDelete, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent.func RemoveKey
RemoveKey deletes a key from the database
Uses: context.Get, db.AccessKey, db.ErrInvalidOperation, db.EventKey, fmt.Sprintf, helpers.EventLog, helpers.EventLogDelete, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent.func RemoveRepository
RemoveRepository deletes a repository from a project in the database
Uses: context.Get, db.ErrInvalidOperation, db.EventRepository, db.Repository, errors.Is, fmt.Sprintf, helpers.EventLog, helpers.EventLogDelete, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent, util.LogWarning.func RemoveSchedule
RemoveSchedule deletes a schedule from the database
Uses: context.Get, db.EventSchedule, db.Schedule, fmt.Sprintf, helpers.EventLog, helpers.EventLogDelete, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, http.StatusNoContent.func RemoveTask
RemoveTask removes a task from the database
Uses: context.Get, db.Project, db.Task, db.User, helpers.Store, helpers.TaskPool, http.StatusBadRequest, http.StatusNoContent, http.StatusUnauthorized, log.Fields, log.Warn, util.LogErrorF.func RemoveTemplate
RemoveTemplate deletes a template from the database
Uses: context.Get, db.EventTemplate, db.Template, fmt.Sprintf, helpers.EventLog, helpers.EventLogDelete, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, http.StatusNoContent.func RemoveUser
RemoveUser removes a user from a project team
Uses: context.Get, db.User.func RemoveView
RemoveView deletes a view from the database
Uses: context.Get, db.EventView, db.View, fmt.Sprintf, helpers.EventLog, helpers.EventLogDelete, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, http.StatusNoContent.func RepositoryMiddleware
RepositoryMiddleware ensures a repository exists and loads it to the context
Uses: context.Get, context.Set, db.Project, helpers.GetIntParam, helpers.Store, helpers.WriteError, http.HandlerFunc, http.Request, http.ResponseWriter.func Restore
func RunnerMiddleware
func SchedulesMiddleware
SchedulesMiddleware ensures a template exists and loads it to the context
Uses: context.Get, context.Set, db.Project, helpers.GetIntParam, helpers.Store, helpers.WriteError, http.HandlerFunc, http.Request, http.ResponseWriter.func SetRunnerActive
func SetScheduleActive
func SetTemplateInventory
func SetTerraformInventoryAliasAccessKey
func SetViewPositions
func StopTask
func TemplatesMiddleware
TemplatesMiddleware ensures a template exists and loads it to the context
Uses: context.Get, context.Set, db.Project, helpers.GetIntParam, helpers.Store, helpers.WriteError, http.HandlerFunc, http.Request, http.ResponseWriter.func UpdateEnvironment
UpdateEnvironment updates an existing environment in the database
Uses: context.Get, db.Environment, db.EventEnvironment, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogItem, helpers.EventLogUpdate, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent.func UpdateIntegration
func UpdateIntegrationExtractValue
func UpdateIntegrationMatcher
func UpdateInventory
UpdateInventory writes updated values to an existing inventory item in the database
Uses: context.Get, db.EventInventory, db.Inventory, db.InventoryFile, db.InventoryStatic, db.InventoryStaticYaml, db.InventoryTerraformWorkspace, db.InventoryTofuWorkspace, db.ValidateInventory, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogItem, helpers.EventLogUpdate, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteErrorStatus, http.StatusBadRequest, http.StatusNoContent.func UpdateKey
UpdateKey updates key in database nolint: gocyclo
Uses: context.Get, db.AccessKey, db.EventKey, db.RetrieveQueryParams, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogItem, helpers.EventLogUpdate, helpers.Store, helpers.UserFromContext, helpers.WriteError, http.StatusNoContent.func UpdateProject
UpdateProject saves updated project details to the database
Uses: context.Get, db.Project, helpers.Bind, helpers.Store, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent.func UpdateRepository
UpdateRepository updates the values of a repository in the database
Uses: context.Get, db.EventRepository, db.Repository, db.ValidateRepository, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogItem, helpers.EventLogUpdate, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent, util.LogWarning.func UpdateRunner
func UpdateSchedule
UpdateSchedule writes a schedule to an existing key in the database
Uses: context.Get, db.EventSchedule, db.Schedule, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogItem, helpers.EventLogUpdate, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent.func UpdateTemplate
UpdateTemplate writes a template to an existing key in the database
Uses: context.Get, db.EventTemplate, db.Template, db.TemplateBuild, db.TemplateDeploy, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogItem, helpers.EventLogUpdate, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteErrorStatus, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent, util.Config.func UpdateTemplateDescription
func UpdateUser
func UpdateView
UpdateView updates key in database nolint: gocyclo
Uses: context.Get, db.EventView, db.View, fmt.Sprintf, helpers.Bind, helpers.EventLog, helpers.EventLogItem, helpers.EventLogUpdate, helpers.Store, helpers.UserFromContext, helpers.WriteError, helpers.WriteJSON, http.StatusBadRequest, http.StatusNoContent.func UserMiddleware
UserMiddleware ensures a user exists and loads it to the context
Uses: context.Get, context.Set, db.Project, helpers.GetIntParam, helpers.Store, helpers.WriteError, http.HandlerFunc, http.Request, http.ResponseWriter.func ValidateScheduleCronFormat
func ViewMiddleware
ViewMiddleware ensures a key exists and loads it to the context
Uses: context.Get, context.Set, db.Project, helpers.GetIntParam, helpers.Store, helpers.WriteError, http.HandlerFunc, http.Request, http.ResponseWriter.Private functions
func createDemoProject
func getPublicAlias
func getPublicAliases
func outputToBytes
func refreshSchedulePool
func removeUser
removeUser removes a user from a project team
References: context.Get, db.EventUser, db.Project, db.ProjectOwner, db.ProjectUserRole, db.User, fmt.Errorf, fmt.Sprintf, helpers.EventLog, helpers.EventLogDelete, helpers.EventLogItem, helpers.Store, helpers.UserFromContext, helpers.WriteError, http.StatusNoContent.func updateEnvironmentSecrets
func validateCronFormat
Tests
Files: 1. Third party imports: 0. Imports from organisation: 0. Tests: 1. Benchmarks: 0.