Documentation
¶
Overview ¶
Package codec provides the Transcodely JSON wire codec.
This file is a verbatim copy of github.com/transcodely/api/internal/connect/codec.go at commit eca70c69a494b2d9cc75b79aea5580324a99a77b. Do NOT edit here — edit upstream in the api repo and resync. CI verifies the two files match.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProtoJSONCodec ¶
type ProtoJSONCodec struct {
// contains filtered or unexported fields
}
ProtoJSONCodec is a JSON codec that uses snake_case field names and simplified lowercase enum values. This provides a REST-like JSON format matching our database conventions.
Example transformations:
- field names: "basePath" → "base_path"
- enums: "JOB_STATUS_PENDING" → "pending"
- enums: "ORIGIN_PROVIDER_GCS" → "gcs"
The codec uses proto reflection to automatically handle all enums, including future additions, without any hardcoded mappings.
func NewProtoJSONCodec ¶
func NewProtoJSONCodec() *ProtoJSONCodec
NewProtoJSONCodec creates a new JSON codec with snake_case field names and simplified enum values.