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


Golang namer.NewRawNamer函數代碼示例

本文整理匯總了Golang中k8s/io/gengo/namer.NewRawNamer函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewRawNamer函數的具體用法?Golang NewRawNamer怎麽用?Golang NewRawNamer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: NameSystems

// NameSystems returns the name system used by the generators in this package.
func NameSystems() namer.NameSystems {
	return namer.NameSystems{
		"public":  namer.NewPublicNamer(0),
		"private": namer.NewPrivateNamer(0),
		"raw":     namer.NewRawNamer("", nil),
	}
}
開發者ID:jbeda,項目名稱:kubernetes,代碼行數:8,代碼來源:sets.go

示例2: NameSystems

// NameSystems returns the name system used by the generators in this package.
func NameSystems() namer.NameSystems {
	return namer.NameSystems{
		"public":    conversionNamer(),
		"raw":       namer.NewRawNamer("", nil),
		"defaultfn": defaultFnNamer(),
	}
}
開發者ID:ncdc,項目名稱:kubernetes,代碼行數:8,代碼來源:conversion.go

示例3: NameSystems

// NameSystems returns the name system used by the generators in this package.
func NameSystems() namer.NameSystems {
	return namer.NameSystems{
		"public":          namer.NewPublicNamer(1),
		"raw":             namer.NewRawNamer("", nil),
		"defaultfn":       defaultFnNamer(),
		"objectdefaultfn": objectDefaultFnNamer(),
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:9,代碼來源:defaulter.go

示例4: Namers

func (g *genericGenerator) Namers(c *generator.Context) namer.NameSystems {
	pluralExceptions := map[string]string{
		"Endpoints": "Endpoints",
	}
	return namer.NameSystems{
		"raw":                namer.NewRawNamer(g.outputPackage, g.imports),
		"allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions),
		"publicPlural":       namer.NewPublicPluralNamer(pluralExceptions),
	}
}
開發者ID:alex-mohr,項目名稱:kubernetes,代碼行數:10,代碼來源:generic.go

示例5: testOpenAPITypeWritter

func testOpenAPITypeWritter(t *testing.T, code string) (error, *assert.Assertions, *bytes.Buffer) {
	assert := assert.New(t)
	var testFiles = map[string]string{
		"base/foo/bar.go": code,
	}
	rawNamer := namer.NewRawNamer("o", nil)
	namers := namer.NameSystems{
		"raw": namer.NewRawNamer("", nil),
	}
	builder, universe, _ := construct(t, testFiles, rawNamer)
	context, err := generator.NewContext(builder, namers, "raw")
	if err != nil {
		t.Fatal(err)
	}
	buffer := &bytes.Buffer{}
	sw := generator.NewSnippetWriter(buffer, context, "$", "$")
	blahT := universe.Type(types.Name{Package: "base/foo", Name: "Blah"})
	return newOpenAPITypeWriter(sw).generate(blahT), assert, buffer
}
開發者ID:ConnorDoyle,項目名稱:kubernetes,代碼行數:19,代碼來源:openapi_test.go

示例6: Namers

func (g *genConversion) Namers(c *generator.Context) namer.NameSystems {
	// Have the raw namer for this file track what it imports.
	return namer.NameSystems{
		"raw": namer.NewRawNamer(g.targetPackage, g.imports),
		"publicIT": &namerPlusImportTracking{
			delegate: conversionNamer(),
			tracker:  g.imports,
		},
	}
}
開發者ID:ncdc,項目名稱:kubernetes,代碼行數:10,代碼來源:conversion.go

示例7: Namers

func (g *genDeepCopy) Namers(c *generator.Context) namer.NameSystems {
	// Have the raw namer for this file track what it imports.
	return namer.NameSystems{
		"raw": namer.NewRawNamer(g.targetPackage, g.imports),
		"dcFnName": &dcFnNamer{
			public:    deepCopyNamer(),
			tracker:   g.imports,
			myPackage: g.targetPackage,
		},
	}
}
開發者ID:jbeda,項目名稱:kubernetes,代碼行數:11,代碼來源:deepcopy.go

示例8: NameSystems

// NameSystems returns the name system used by the generators in this package.
func NameSystems() namer.NameSystems {
	pluralExceptions := map[string]string{
		"Endpoints": "Endpoints",
	}
	return namer.NameSystems{
		"public":             namer.NewPublicNamer(0),
		"private":            namer.NewPrivateNamer(0),
		"raw":                namer.NewRawNamer("", nil),
		"publicPlural":       namer.NewPublicPluralNamer(pluralExceptions),
		"privatePlural":      namer.NewPrivatePluralNamer(pluralExceptions),
		"allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions),
	}
}
開發者ID:pst,項目名稱:kubernetes,代碼行數:14,代碼來源:client_generator.go

示例9: NameSystems

// NameSystems returns the name system used by the generators in this package.
func NameSystems() namer.NameSystems {
	return namer.NameSystems{
		"raw": namer.NewRawNamer("", nil),
	}
}
開發者ID:eljefedelrodeodeljefe,項目名稱:kubernetes,代碼行數:6,代碼來源:openapi.go

示例10: Namers

func (g *openAPIGen) Namers(c *generator.Context) namer.NameSystems {
	// Have the raw namer for this file track what it imports.
	return namer.NameSystems{
		"raw": namer.NewRawNamer(g.targetPackage.Path, g.imports),
	}
}
開發者ID:eljefedelrodeodeljefe,項目名稱:kubernetes,代碼行數:6,代碼來源:openapi.go

示例11: NameSystems

// NameSystems returns the name system used by the generators in this package.
func NameSystems() namer.NameSystems {
	return namer.NameSystems{
		"public": deepCopyNamer(),
		"raw":    namer.NewRawNamer("", nil),
	}
}
開發者ID:jbeda,項目名稱:kubernetes,代碼行數:7,代碼來源:deepcopy.go

示例12: Namers

func (g *versionInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems {
	return namer.NameSystems{
		"raw": namer.NewRawNamer(g.outputPackage, g.imports),
	}
}
開發者ID:alex-mohr,項目名稱:kubernetes,代碼行數:5,代碼來源:versioninterface.go

示例13: Namers

func (g *genDefaulter) Namers(c *generator.Context) namer.NameSystems {
	// Have the raw namer for this file track what it imports.
	return namer.NameSystems{
		"raw": namer.NewRawNamer(g.targetPackage, g.imports),
	}
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:6,代碼來源:defaulter.go


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