當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。