package proto
import "github.com/moby/buildkit/util/gogo/proto"
Package proto is a transition package for methods from gogo that are used within buildkit and don't have an existing method in the standard protobuf library.
Index ¶
- func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error)
- func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error)
Functions ¶
func MarshalJSONEnum ¶
func UnmarshalJSONEnum ¶
UnmarshalJSONEnum is a helper function to simplify recovering enum int values from their JSON-encoded representation. Given a map from the enum's symbolic names to its int values, and a byte buffer containing the JSON-encoded value, it returns an int32 that can be cast to the enum type by the caller.
The function can deal with both JSON representations, numeric and symbolic.
Source Files ¶
- Version
- v0.21.0 (latest)
- Published
- Apr 11, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 2 days ago –
Tools for package owners.