doc.go 1.4 KB

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