Documentation
¶
Index ¶
- Constants
- func InitRoutes(useLogger bool, handler *PcApi) *gin.Engine
- func StartHttpServerWithTCP(useLogger bool, port int, project app.IProject) (*http.Server, error)
- func StartHttpServerWithUnixSocket(useLogger bool, unixSocket string, project app.IProject) (*http.Server, error)
- type LogMessage
- type PcApi
- func (api *PcApi) GetHostName(c *gin.Context)
- func (api *PcApi) GetProcess(c *gin.Context)
- func (api *PcApi) GetProcessInfo(c *gin.Context)
- func (api *PcApi) GetProcessLogs(c *gin.Context)
- func (api *PcApi) GetProcessPorts(c *gin.Context)
- func (api *PcApi) GetProcesses(c *gin.Context)
- func (api *PcApi) GetProjectState(c *gin.Context)
- func (api *PcApi) HandleLogsStream(c *gin.Context)
- func (api *PcApi) IsAlive(c *gin.Context)
- func (api *PcApi) ReloadProject(c *gin.Context)
- func (api *PcApi) RestartProcess(c *gin.Context)
- func (api *PcApi) ScaleProcess(c *gin.Context)
- func (api *PcApi) ShutDownProject(c *gin.Context)
- func (api *PcApi) StartProcess(c *gin.Context)
- func (api *PcApi) StopProcess(c *gin.Context)
- func (api *PcApi) StopProcesses(c *gin.Context)
- func (api *PcApi) UpdateProcess(c *gin.Context)
- func (api *PcApi) UpdateProject(c *gin.Context)
Constants ¶
const EnvDebugMode = "PC_DEBUG_MODE"
Variables ¶
This section is empty.
Functions ¶
func InitRoutes ¶
InitRoutes initialize routing information
func StartHttpServerWithTCP ¶ added in v1.2.0
Types ¶
type LogMessage ¶ added in v0.43.1
type PcApi ¶ added in v0.50.0
type PcApi struct {
// contains filtered or unexported fields
}
func (*PcApi) GetHostName ¶ added in v0.50.0
@Schemes @Id GetHostName @Description Get process compose hostname @Tags Hostname @Summary Get Hostname @Produce json @Success 200 {object} map[string]string "Hostname" @Failure 400 {object} map[string]string @Router /hostname [get]
func (*PcApi) GetProcess ¶ added in v0.50.0
@Schemes @Id GetProcess @Description Retrieves the given process and its status @Tags Process @Summary Get process state @Produce json @Param name path string true "Process Name" @Success 200 {object} types.ProcessState @Failure 400 {object} map[string]string @Router /process/{name} [get]
func (*PcApi) GetProcessInfo ¶ added in v0.50.0
@Schemes @Id GetProcessInfo @Description Retrieves the given process and its config @Tags Process @Summary Get process config @Produce json @Param name path string true "Process Name" @Success 200 {object} types.ProcessConfig @Failure 400 {object} map[string]string @Router /process/info/{name} [get]
func (*PcApi) GetProcessLogs ¶ added in v0.50.0
@Schemes @Id GetProcessLogs @Description Retrieves the process logs @Tags Process @Summary Get process logs @Produce json @Param name path string true "Process Name" @Param endOffset path int true "Offset from the end of the log" @Param limit path int true "Limit of lines to get (0 will get all the lines till the end)" @Success 200 {object} map[string][]string "Process Logs" @Failure 400 {object} map[string]string @Router /process/logs/{name}/{endOffset}/{limit} [get]
func (*PcApi) GetProcessPorts ¶ added in v0.55.0
@Schemes @Id GetProcessPorts @Description Retrieves process open ports @Tags Process @Summary Get process ports @Produce json @Param name path string true "Process Name" @Success 200 {object} types.ProcessPorts "Process Ports" @Failure 400 {object} map[string]string @Router /process/ports/{name} [get]
func (*PcApi) GetProcesses ¶ added in v0.50.0
@Schemes @Id GetProcesses @Description Retrieves all the configured processes and their status @Tags Process @Summary Get all processes @Produce json @Success 200 {object} types.ProcessesState "Processes Status" @Failure 400 {object} map[string]string @Router /processes [get]
func (*PcApi) GetProjectState ¶ added in v0.75.0
@Schemes @Id GetProjectState @Description Retrieves project state information @Tags Project @Summary Get project state @Produce json @Success 200 {object} types.ProjectState "Project State" @Failure 500 {object} map[string]string @Router /project/state [get]
func (*PcApi) HandleLogsStream ¶ added in v0.50.0
func (*PcApi) IsAlive ¶ added in v0.50.0
@Schemes @Id IsAlive @Description Check if server is responding @Tags Liveness @Summary Liveness Check @Produce json @Success 200 @Router /live [get]
func (*PcApi) ReloadProject ¶ added in v1.34.0
@Schemes @Id ReloadProject @Description Reload project state from config @Tags Project @Summary Reload project @Produce json @Success 200 {object} map[string]string "Update Project Status" @Success 207 {object} map[string]string "Update Project Status" @Failure 400 {object} map[string]string @Router /project/configuration [post]
func (*PcApi) RestartProcess ¶ added in v0.50.0
@Schemes @Id RestartProcess @Description Restarts the process @Tags Process @Summary Restart a process @Produce json @Param name path string true "Process Name" @Success 200 {object} map[string]string "Restarted Process Name" @Failure 400 {object} map[string]string @Router /process/restart/{name} [post]
func (*PcApi) ScaleProcess ¶ added in v0.55.0
@Schemes @Id ScaleProcess @Description Scale a process @Tags Process @Summary Scale a process to a given replicas count @Produce json @Param name path string true "Process Name" @Param scale path int true "New amount of process replicas" @Success 200 {object} map[string]string "Scaled Process Name" @Failure 400 {object} map[string]string @Router /process/scale/{name}/{scale} [patch]
func (*PcApi) ShutDownProject ¶ added in v0.69.0
@Schemes @Id ShutDownProject @Description Shuts down the server @Tags Project @Summary Stops all the processes and the server @Produce json @Success 200 {object} map[string]string "Stopped Server" @Router /project/stop [post]
func (*PcApi) StartProcess ¶ added in v0.50.0
@Schemes @Id StartProcess @Description Starts the process if the state is not 'running' or 'pending' @Tags Process @Summary Start a process @Produce json @Param name path string true "Process Name" @Success 200 {object} map[string]string "Started Process Name" @Failure 400 {object} map[string]string @Router /process/start/{name} [post]
func (*PcApi) StopProcess ¶ added in v0.50.0
@Schemes @Id StopProcess @Description Sends kill signal to the process @Tags Process @Summary Stop a process @Produce json @Param name path string true "Process Name" @Success 200 {object} map[string]string "Stopped Process Name" @Failure 400 {object} map[string]string @Router /process/stop/{name} [patch]
func (*PcApi) StopProcesses ¶ added in v0.60.0
@Schemes @Id StopProcesses @Description Sends kill signal to the processes list @Tags Process @Summary Stop processes @Accept json
@Param []string body []string true "Processes Names"
@Produce json @Success 200 {object} map[string]string "Stopped Processes Names" @Success 207 {object} map[string]string "Stopped Processes Names" @Failure 400 {object} map[string]string @Router /processes/stop [patch]
func (*PcApi) UpdateProcess ¶ added in v1.34.0
@Schemes @Id UpdateProcess @Description Update porcess @Tags Process @Summary Updates process configuration @Produce json @Success 200 {object} types.ProcessConfig "Updated Process Config" @Failure 400 {object} map[string]string @Router /process [post]
func (*PcApi) UpdateProject ¶ added in v1.27.0
@Schemes @Id UpdateProject @Description Update running project @Tags Project @Summary Updates running processes @Produce json @Success 200 {object} map[string]string "Update Project Status" @Success 207 {object} map[string]string "Update Project Status" @Failure 400 {object} map[string]string @Router /project [post]