本文整理匯總了Golang中github.com/coreos/rkt/tests/testutils/aci-server.Server類的典型用法代碼示例。如果您正苦於以下問題:Golang Server類的具體用法?Golang Server怎麽用?Golang Server使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Server類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newStubStage1Setup
func newStubStage1Setup(t *testing.T, serverSetup *taas.ServerSetup) *stubStage1Setup {
ctx := testutils.NewRktRunCtx()
defer func() {
if ctx != nil {
ctx.Cleanup()
}
}()
var server *taas.Server
stubStage1 := testutils.GetValueFromEnvOrPanic("STUB_STAGE1")
if serverSetup != nil {
server = runServer(t, serverSetup)
defer func() {
if server != nil {
server.Close()
}
}()
fileSet := map[string]string{
filepath.Base(stubStage1): stubStage1,
}
if err := server.UpdateFileSet(fileSet); err != nil {
t.Fatalf("Failed to populate a file list in test aci server: %v", err)
}
}
setup := &stubStage1Setup{
t: t,
ctx: ctx,
server: server,
name: "localhost/rkt-stub-stage1",
version: "0.0.1",
path: stubStage1,
}
ctx = nil
server = nil
return setup
}
示例2: authCleanup
func authCleanup(server *taas.Server, image string) {
server.Close()
_ = os.Remove(image)
}