本文整理匯總了Golang中github.com/elodina/stack-deploy/framework.Variables.MustGet方法的典型用法代碼示例。如果您正苦於以下問題:Golang Variables.MustGet方法的具體用法?Golang Variables.MustGet怎麽用?Golang Variables.MustGet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/elodina/stack-deploy/framework.Variables
的用法示例。
在下文中一共展示了Variables.MustGet方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: RunTask
func (etr *ExhibitorTaskRunner) RunTask(context *framework.Variables, application *framework.Application, task map[string]string) error {
api := context.MustGet(fmt.Sprintf("%s.api", application.ID))
client := NewExhibitorMesosClient(api)
_, err := client.Add(task)
if err != nil {
return err
}
_, err = client.Update(task)
if err != nil {
return err
}
response, err := client.Start(task)
if err != nil {
return err
}
err = etr.fillTaskContext(context, application, response)
if err != nil {
return err
}
return client.AwaitZookeeperRunning()
}
示例2: RunTask
func (ztr *ZipkinTaskRunner) RunTask(context *framework.Variables, application *framework.Application, task map[string]string) error {
api := context.MustGet(fmt.Sprintf("%s.api", application.ID))
id, ok := task["id"]
if !ok {
return errors.New("Missing task id")
}
taskType, ok := task["type"]
if !ok {
return fmt.Errorf("Missing task type for id %s", id)
}
client := NewZipkinMesosClient(api)
_, err := client.Add(task)
if err != nil {
return err
}
response, err := client.Start(task)
if err != nil {
return err
}
if taskType == "query" {
return ztr.fillTaskContext(context, application, response)
}
return nil
}
示例3: RunTask
func (str *StatsdTaskRunner) RunTask(context *framework.Variables, application *framework.Application, task map[string]string) error {
api := context.MustGet(fmt.Sprintf("%s.api", application.ID))
client := NewStatsdMesosClient(api)
err := client.Update(task)
if err != nil {
return err
}
return client.Start(task)
}
示例4: RunTask
func (dtr *DSETaskRunner) RunTask(context *framework.Variables, application *framework.Application, task map[string]string) error {
api := context.MustGet(fmt.Sprintf("%s.api", application.ID))
client := NewDSEMesosClient(api)
_, err := client.Add(task)
if err != nil {
return err
}
response, err := client.Start(task)
if err != nil {
return err
}
return dtr.fillTaskContext(context, application, response)
}