api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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) CheckAuth added in v0.4.0

func (e *API) CheckAuth(r *http.Request, w http.ResponseWriter) bool

CheckAuth will check if the token is valid

func (*API) Commands added in v0.4.0

func (e *API) Commands() *mux.Router

Commands is the main function of this package

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

func (e *API) CountRedisKey(pattern string) int

CountRedisKey will get back the count of the redis key

func (*API) DelRedisKey added in v0.4.0

func (e *API) DelRedisKey(key string) int64

DelRedisKey will delete a redis key

func (*API) ErrorMessage added in v0.4.0

func (e *API) ErrorMessage(number int, function string, msg string) []byte

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

func (e *API) GetRedisKey(key string) string

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) PingRedis added in v0.4.0

func (e *API) PingRedis() error

PingRedis to check the health of redis

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

func (*API) Versions added in v0.4.0

func (e *API) Versions(w http.ResponseWriter, r *http.Request)

Versions give out a list of Versions

type Redis added in v0.4.1

type Redis struct {
	RedisClient *goredis.Client
	RedisCTX    context.Context
}

Redis struct about the redis connection

Jump to

Keyboard shortcuts

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