當前位置: 首頁>>代碼示例>>Golang>>正文


Golang backend.Backend類代碼示例

本文整理匯總了Golang中github.com/cloudfoundry-incubator/stager/backend.Backend的典型用法代碼示例。如果您正苦於以下問題:Golang Backend類的具體用法?Golang Backend怎麽用?Golang Backend使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Backend類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1:

	"github.com/pivotal-golang/lager"
	"github.com/pivotal-golang/lager/lagertest"
)

var _ = Describe("DockerBackend", func() {
	var (
		stagingRequest        cc_messages.StagingRequestFromCC
		downloadBuilderAction models.ActionInterface
		runAction             models.ActionInterface
		config                backend.Config
		logger                lager.Logger
		docker                backend.Backend

		stagingGuid       string
		appId             string
		dockerImageUrl    string
		dockerLoginServer string
		dockerUser        string
		dockerPassword    string
		dockerEmail       string
		fileDescriptors   int
		memoryMb          int32
		diskMb            int32
		timeout           int
		egressRules       []*models.SecurityGroupRule
	)

	BeforeEach(func() {
		appId = "bunny"
		dockerImageUrl = "busybox"
		dockerLoginServer = ""
開發者ID:guanglinlv,項目名稱:stager,代碼行數:31,代碼來源:docker_backend_test.go

示例2:

		var mountCgroupsAction = models.EmitProgressFor(
			&models.RunAction{
				Path: "/tmp/docker_app_lifecycle/mount_cgroups",
				ResourceLimits: &models.ResourceLimits{
					Nofile: &fileDescriptorLimit,
				},
				User: "root",
			},
			"Preparing docker daemon...",
			"",
			"Failed to set up docker environment",
		)

		var (
			dockerBackend     backend.Backend
			dockerRegistryIPs []string
			consulCluster     *ghttp.Server
			stagingRequest    cc_messages.StagingRequestFromCC
		)

		BeforeEach(func() {
			dockerRegistryIPs = []string{"10.244.2.6", "10.244.2.7"}
			consulCluster = newConsulCluster(dockerRegistryIPs)
		})

		Context("user did not opt-in for docker image caching", func() {
			BeforeEach(func() {
				dockerBackend = setupDockerBackend(validDockerRegistryAddress, []string{}, consulCluster)
				stagingRequest = setupStagingRequest(false, "", "", "", "")
			})

			It("creates a cf-app-docker-staging Task with no additional egress rules", func() {
開發者ID:emc-xchallenge,項目名稱:stager,代碼行數:32,代碼來源:docker_registry_test.go

示例3:

)

var _ = Describe("TraditionalBackend", func() {
	var (
		traditional                    backend.Backend
		stagingRequest                 cc_messages.StagingRequestFromCC
		config                         backend.Config
		buildpackOrder                 string
		timeout                        int
		stack                          string
		memoryMb                       int32
		diskMb                         int32
		fileDescriptors                int
		buildArtifactsCacheDownloadUri string
		appId                          string
		stagingGuid                    string
		buildpacks                     []cc_messages.Buildpack
		appBitsDownloadUri             string
		downloadBuilderAction          models.ActionInterface
		downloadAppAction              models.ActionInterface
		downloadFirstBuildpackAction   models.ActionInterface
		downloadSecondBuildpackAction  models.ActionInterface
		downloadBuildArtifactsAction   models.ActionInterface
		runAction                      models.ActionInterface
		uploadDropletAction            models.ActionInterface
		uploadBuildArtifactsAction     models.ActionInterface
		egressRules                    []*models.SecurityGroupRule
		environment                    []*models.EnvironmentVariable
	)

	BeforeEach(func() {
		stagerURL := "http://the-stager.example.com"
開發者ID:emc-xchallenge,項目名稱:stager,代碼行數:32,代碼來源:buildpack_backend_test.go

示例4:

			LifecycleData:   &lifecycleData,
		}
	}

	BeforeEach(func() {
		loginServer = ""
		user = ""
		password = ""
		email = ""
	})

	Context("when docker registry is running", func() {
		var (
			downloadBuilderAction  models.ActionInterface
			docker                 backend.Backend
			expectedRunAction      models.ActionInterface
			expectedEgressRules    []*models.SecurityGroupRule
			insecureDockerRegistry bool
			stagingRequest         cc_messages.StagingRequestFromCC
		)

		setupEgressRules := func(ips []string) []*models.SecurityGroupRule {
			rules := []*models.SecurityGroupRule{}
			for _, ip := range ips {
				rules = append(rules, &models.SecurityGroupRule{
					Protocol:     models.TCPProtocol,
					Destinations: []string{ip},
					Ports:        []uint32{dockerRegistryPort},
				})
			}
			return rules
		}
開發者ID:guanglinlv,項目名稱:stager,代碼行數:32,代碼來源:docker_registry_test.go


注:本文中的github.com/cloudfoundry-incubator/stager/backend.Backend類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。