blob: d8e12534a44ee7159d7948d0014595925399f96a [file] [log] [blame]
Matthias Andreas Benkard832a54e2019-01-29 09:27:38 +01001/*
2Copyright 2015 The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17// Package generator defines an interface for code generators to implement.
18//
19// To use this package, you'll implement the "Package" and "Generator"
20// interfaces; you'll call NewContext to load up the types you want to work
21// with, and then you'll call one or more of the Execute methods. See the
22// interface definitions for explanations. All output will have gofmt called on
23// it automatically, so you do not need to worry about generating correct
24// indentation.
25//
26// This package also exposes SnippetWriter. SnippetWriter reduces to a minimum
27// the boilerplate involved in setting up a template from go's text/template
28// package. Additionally, all naming systems in the Context will be added as
29// functions to the parsed template, so that they can be called directly from
30// your templates!
31package generator // import "k8s.io/gengo/generator"