本文整理匯總了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)
}
示例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
}
示例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)
}
示例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
}
示例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
}
示例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
}
示例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)
}
示例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
}
示例9: ListUnitFiles
func ListUnitFiles(b backend.Backend) error {
err := b.ListUnitFiles()
return err
}
示例10: Restart
func Restart(b backend.Backend, targets []string) error {
if err := b.Stop(targets); err != nil {
return err
}
return b.Start(targets)
}