package defval
import "github.com/knqyf263/go-plugin/encoding/defval"
Package defval marshals and unmarshals textual forms of default values.
This package handles both the form historically used in Go struct field tags and also the form used by google.protobuf.FieldDescriptorProto.default_value since they differ in superficial ways.
Index ¶
- func Marshal(v protoreflect.Value, ev protoreflect.EnumValueDescriptor, k protoreflect.Kind, f Format) (string, error)
- type Format
Functions ¶
func Marshal ¶
func Marshal(v protoreflect.Value, ev protoreflect.EnumValueDescriptor, k protoreflect.Kind, f Format) (string, error)
Marshal serializes v as the default string according to the given kind k. When specifying the Descriptor format for an enum kind, the associated enum value descriptor must be provided.
Types ¶
type Format ¶
type Format int
Format is the serialization format used to represent the default value.
const ( // GoTag uses the historical serialization format in Go struct field tags. GoTag Format )
Source Files ¶
- Version
- v0.4.0
- Published
- Dec 1, 2022
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 3 days ago –
Tools for package owners.