Example #1
0
// Find all apps
func (r Apps) Get(c *echo.Context, s *dokku.Dokku) error {
	// fields := strings.Split(c.Param("fields"), ",")

	apps, err := s.Apps.FindAll()
	if err != nil {
		return err
	}

	return c.JSONIndent(http.StatusOK, apps, "", "  ")
}
Example #2
0
// Find one app
func (r App) Get(c *echo.Context, s *dokku.Dokku) error {
	name := c.P(0)

	app, err := s.Apps.Find(name)
	if err != nil {
		return err
	}

	if app == nil {
		return c.NoContent(http.StatusNotFound)
	}

	return c.JSONIndent(http.StatusOK, app, "", "  ")
}
Example #3
0
func raw(c *echo.Context) error {
	globalData.Calculate()
	return c.JSONIndent(200, globalData, "", "  ")
}
Example #4
0
func update(c *echo.Context) error {
	globalData.UpdateDB(true)
	globalData.Calculate()
	return c.JSONIndent(200, globalData, "", "  ")
}