protobufgoogle.golang.org/protobuf/internal/protobuild Index | Files

package protobuild

import "google.golang.org/protobuf/internal/protobuild"

Package protobuild constructs messages.

This package is used to construct multiple types of message with a similar shape from a common template.

Index

Constants

const Unknown = "@unknown"

Unknown is a key associated with the unknown fields of a message. The value should be a []byte.

Types

type Message

type Message map[protoreflect.Name]Value

A Message is a template to apply to a message. Keys are field names, including extension names.

func (Message) Build

func (template Message) Build(m protoreflect.Message)

Build applies the template to a message.

type Value

type Value any

A Value is a value assignable to a field. A Value may be a value accepted by protoreflect.ValueOf. In addition:

• An int may be assigned to any numeric field.

• A float64 may be assigned to a double field.

• Either a string or []byte may be assigned to a string or bytes field.

• A string containing the value name may be assigned to an enum field.

• A slice may be assigned to a list, and a map may be assigned to a map.

Source Files

build.go

Version
v1.36.6 (latest)
Published
Mar 24, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
2 hours ago

Tools for package owners.