当前位置: 首页>>代码示例>>Golang>>正文


Golang backend.Backend类代码示例

本文整理汇总了Golang中github.com/deis/deisctl/backend.Backend的典型用法代码示例。如果您正苦于以下问题:Golang Backend类的具体用法?Golang Backend怎么用?Golang Backend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Backend类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Start

func Start(b backend.Backend, targets []string) error {
	// if target is platform, start all services
	if len(targets) == 1 && targets[0] == PlatformInstallCommand {
		return StartPlatform(b)
	}
	return b.Start(targets)
}
开发者ID:tob1k,项目名称:deisctl,代码行数:7,代码来源:cmd.go

示例2: startDataContainers

func startDataContainers(b backend.Backend) error {
	fmt.Println("Launching data containers...")
	if err := b.Start(DefaultDataContainers); err != nil {
		return err
	}
	fmt.Println("Data containers launched.")
	return nil
}
开发者ID:tob1k,项目名称:deisctl,代码行数:8,代码来源:cmd.go

示例3: Uninstall

func Uninstall(b backend.Backend, targets []string) error {
	// if target is platform, uninstall all services
	if len(targets) == 1 && targets[0] == PlatformInstallCommand {
		return uninstallAllServices(b)
	}
	// uninstall the specific target
	return b.Destroy(targets)
}
开发者ID:tob1k,项目名称:deisctl,代码行数:8,代码来源:cmd.go

示例4: installDataContainers

func installDataContainers(b backend.Backend) error {
	fmt.Println("Scheduling data containers...")
	if err := b.Create(DefaultDataContainers); err != nil {
		return err
	}
	fmt.Println("Data containers scheduled.")
	return nil
}
开发者ID:tob1k,项目名称:deisctl,代码行数:8,代码来源:cmd.go

示例5: Journal

func Journal(b backend.Backend, targets []string) error {
	for _, target := range targets {
		if err := b.Journal(target); err != nil {
			return err
		}
	}
	return nil
}
开发者ID:tob1k,项目名称:deisctl,代码行数:8,代码来源:cmd.go

示例6: Status

func Status(b backend.Backend, targets []string) error {
	for _, target := range targets {
		if err := b.Status(target); err != nil {
			return err
		}
	}
	return nil
}
开发者ID:tob1k,项目名称:deisctl,代码行数:8,代码来源:cmd.go

示例7: Install

func Install(b backend.Backend, targets []string) error {
	// if target is platform, install all services
	if len(targets) == 1 && targets[0] == PlatformInstallCommand {
		return InstallPlatform(b)
	}
	// otherwise create the specific targets
	for i, target := range targets {
		// if we're installing a component without a number attached,
		// consider the user doesn't know better
		if !strings.Contains(target, "@") {
			targets[i] += "@1"
		}
	}
	return b.Create(targets)
}
开发者ID:tob1k,项目名称:deisctl,代码行数:15,代码来源:cmd.go

示例8: Scale

func Scale(b backend.Backend, targets []string) error {
	for _, target := range targets {
		component, num, err := splitScaleTarget(target)
		if err != nil {
			return err
		}
		// the router is the only component that can scale past 1 at the moment
		if num > 1 && !strings.Contains(component, "router") {
			return fmt.Errorf("cannot scale %s past 1", component)
		}
		if err := b.Scale(component, num); err != nil {
			return err
		}
	}
	return nil
}
开发者ID:tob1k,项目名称:deisctl,代码行数:16,代码来源:cmd.go

示例9: ListUnitFiles

func ListUnitFiles(b backend.Backend) error {
	err := b.ListUnitFiles()
	return err
}
开发者ID:tob1k,项目名称:deisctl,代码行数:4,代码来源:cmd.go

示例10: Restart

func Restart(b backend.Backend, targets []string) error {
	if err := b.Stop(targets); err != nil {
		return err
	}
	return b.Start(targets)
}
开发者ID:tob1k,项目名称:deisctl,代码行数:6,代码来源:cmd.go


注:本文中的github.com/deis/deisctl/backend.Backend类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。