Documentation
¶
Overview ¶
Package gen renders the code of a project from embedded templates. Most of the logic lives in the view types, which precompute code fragments so the templates stay readable.
Index ¶
Constants ¶
const ( KubeBaseDir = "deploy/kubernetes/base" KubeOverlayDir = "deploy/kubernetes/overlays/production" )
Kubernetes manifests live in a generated kustomize base and a user-owned overlay. The base only references Secrets by name: codebuild never writes credentials, and the overlay is where images, namespaces and patches go.
const ( ObservabilityDir = "deploy/observability" KubeObservabilityDir = "deploy/kubernetes/components/observability" JaegerImage = "jaegertracing/jaeger:2.21.0" PrometheusImage = "prom/prometheus:v3.14.0" GrafanaImage = "grafana/grafana:12.4.2" )
The observability stack is generated next to the code: Jaeger with its Monitor tab fed by span metrics, Prometheus with alert rules, and Grafana with a dashboard of the project. Docker Compose runs it under the observability profile and Kubernetes gets it as a kustomize component. All three panels live under /_ops/, so the API or the gateway can put them behind the login of the project.
const ( Header = "// Code generated by codebuild. DO NOT EDIT." YAMLHeader = "# Code generated by codebuild. DO NOT EDIT." )
const ( GRPCModule = "google.golang.org/grpc" GRPCVersion = "v1.84.0" ProtobufModule = "google.golang.org/protobuf" ProtobufVersion = "v1.36.12" GatewayDir = "gateway" )
const OpenAPIMarker = "Code generated by codebuild. DO NOT EDIT."
OpenAPIMarker is the value of the x-codebuild member that opens every generated openapi.json. JSON has no comments, so this member plays the role of the "Code generated" header that marks the file as codebuild's.
const OpenAPIPath = "openapi.json"
OpenAPIPath is where the document is written and served.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
Path string
Content []byte
Owner Owner
Domain string
ServiceType string
Receiver string
ServiceMethod string
// ServiceSignature and ServiceParams describe the method the generated
// code calls, so the planner can tell an outdated user method apart.
ServiceSignature string
ServiceParams int
Module string
}
type Pagination ¶
type Workspace ¶
func GenerateWorkspace ¶
func GenerateWorkspace(opts WorkspaceOptions) (*Workspace, error)