Documentation
¶
Index ¶
- type API
- func (e *API) CheckAuth(r *http.Request, w http.ResponseWriter) bool
- func (e *API) Commands() *mux.Router
- func (e *API) ConnectRedis()
- func (e *API) CountRedisKey(pattern string) int
- func (e *API) DelRedisKey(key string) int64
- func (e *API) ErrorMessage(number int, function string, msg string) []byte
- func (e *API) GetAllRedisKeys(pattern string) *goredis.ScanIterator
- func (e *API) GetRedisKey(key string) string
- func (e *API) GetTaskFromEvent(update *mesosproto.Event_Update) mesosutil.Command
- func (e *API) PingRedis() error
- func (e *API) SaveConfig()
- func (e *API) V0ComposeKillService(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ComposeKillTask(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ComposePush(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ComposeRestartService(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ComposeUpdate(w http.ResponseWriter, r *http.Request)
- func (e *API) V0ShowAllTasks(w http.ResponseWriter, r *http.Request)
- func (e *API) Versions(w http.ResponseWriter, r *http.Request)
- type Redis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v0.4.0
type API struct {
Config *cfg.Config
Framework *mesosutil.FrameworkConfig
Service cfg.Service
Compose cfg.Compose
Redis Redis
}
API Service include all the current vars and global config
func New ¶ added in v0.4.0
func New(cfg *cfg.Config, frm *mesosutil.FrameworkConfig) *API
New will create a new API object
func (*API) ConnectRedis ¶ added in v0.4.0
func (e *API) ConnectRedis()
ConnectRedis will connect the redis DB and save the client pointer
func (*API) CountRedisKey ¶ added in v0.4.0
CountRedisKey will get back the count of the redis key
func (*API) DelRedisKey ¶ added in v0.4.0
DelRedisKey will delete a redis key
func (*API) ErrorMessage ¶ added in v0.4.0
ErrorMessage will create a message json
func (*API) GetAllRedisKeys ¶ added in v0.4.0
func (e *API) GetAllRedisKeys(pattern string) *goredis.ScanIterator
GetAllRedisKeys get out all redis keys to a patter
func (*API) GetRedisKey ¶ added in v0.4.0
GetRedisKey get out the data of a key
func (*API) GetTaskFromEvent ¶ added in v0.4.0
func (e *API) GetTaskFromEvent(update *mesosproto.Event_Update) mesosutil.Command
GetTaskFromEvent get out the key by a mesos event
func (*API) SaveConfig ¶ added in v0.4.0
func (e *API) SaveConfig()
SaveConfig store the current framework config
func (*API) V0ComposeKillService ¶ added in v0.4.0
func (e *API) V0ComposeKillService(w http.ResponseWriter, r *http.Request)
V0ComposeKillService will kill a task from a service from a specific project example: curl -X DELETE http://user:password@127.0.0.1:10000/api/compose/v0/{projectname}/{servicename}/{taskid}
func (*API) V0ComposeKillTask ¶ added in v0.4.0
func (e *API) V0ComposeKillTask(w http.ResponseWriter, r *http.Request)
V0ComposeKillTask will kill a task from a service from a specific project example: curl -X DELETE http://user:password@127.0.0.1:10000/api/compose/v0/{projectname}/{servicename}/{taskid}
func (*API) V0ComposePush ¶ added in v0.4.0
func (e *API) V0ComposePush(w http.ResponseWriter, r *http.Request)
V0ComposePush will read and interpret the docker-compose.yml example: curl -X GET http://user:password@127.0.0.1:10000/api/compose/v0 --data-binary @docker-compose.yml
func (*API) V0ComposeRestartService ¶ added in v0.4.0
func (e *API) V0ComposeRestartService(w http.ResponseWriter, r *http.Request)
V0ComposeRestartService will restart a service from a specific project example: curl -X PUT http://user:password@127.0.0.1:10000/api/compose/v0/{projectname}/{servicename}/restart
func (*API) V0ComposeUpdate ¶ added in v0.4.0
func (e *API) V0ComposeUpdate(w http.ResponseWriter, r *http.Request)
V0ComposeUpdate will update the docker-compose.yml example: curl -X GET http://user:password@127.0.0.1:10000/api/compose/v0 --data-binary @docker-compose.yml
func (*API) V0ShowAllTasks ¶ added in v0.4.0
func (e *API) V0ShowAllTasks(w http.ResponseWriter, r *http.Request)
V0ShowAllTasks will print out all tasks example: curl -X GET http://user:password@127.0.0.1:10000/api/compose/v0/tasks