proto

package
v0.17.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalJSONEnum

func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error)

func UnmarshalJSONEnum

func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error)

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL