header_template.go 621 B

12345678910111213141516171819202122232425262728293031
  1. package main
  2. var _headerTemplate = `
  3. // Code generated by $GOPATH/src/go-common/app/tool/cache/gen. DO NOT EDIT.
  4. NEWLINE
  5. /*
  6. Package {{.PkgName}} is a generated cache proxy package.
  7. It is generated from:
  8. ARGS
  9. */
  10. NEWLINE
  11. package {{.PkgName}}
  12. import (
  13. "context"
  14. {{if .EnableBatch }}"sync"{{end}}
  15. NEWLINE
  16. "go-common/library/stat/prom"
  17. {{if .EnableBatch }}"go-common/library/sync/errgroup"{{end}}
  18. {{.ImportPackage}}
  19. NEWLINE
  20. {{if .EnableSingleFlight}} "golang.org/x/sync/singleflight" {{end}}
  21. )
  22. var _ _cache
  23. {{if .EnableSingleFlight}}
  24. var cacheSingleFlights = [SFCOUNT]*singleflight.Group{SFINIT}
  25. {{end }}
  26. `