blob: 08d2a46f53525f1b634c996759e9b760feaf4eb5 [file] [log] [blame]
khenaidoo5fc5cea2021-08-11 17:39:16 -04001// Copyright 2019 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Package proto provides functions operating on protocol buffer messages.
6//
7// For documentation on protocol buffers in general, see:
8//
Joey Armstrongba3d9d12024-01-15 14:22:11 -05009// https://developers.google.com/protocol-buffers
khenaidoo5fc5cea2021-08-11 17:39:16 -040010//
11// For a tutorial on using protocol buffers with Go, see:
12//
Joey Armstrongba3d9d12024-01-15 14:22:11 -050013// https://developers.google.com/protocol-buffers/docs/gotutorial
khenaidoo5fc5cea2021-08-11 17:39:16 -040014//
15// For a guide to generated Go protocol buffer code, see:
16//
Joey Armstrongba3d9d12024-01-15 14:22:11 -050017// https://developers.google.com/protocol-buffers/docs/reference/go-generated
khenaidoo5fc5cea2021-08-11 17:39:16 -040018//
Joey Armstrongba3d9d12024-01-15 14:22:11 -050019// # Binary serialization
khenaidoo5fc5cea2021-08-11 17:39:16 -040020//
21// This package contains functions to convert to and from the wire format,
22// an efficient binary serialization of protocol buffers.
23//
24// • Size reports the size of a message in the wire format.
25//
26// • Marshal converts a message to the wire format.
27// The MarshalOptions type provides more control over wire marshaling.
28//
29// • Unmarshal converts a message from the wire format.
30// The UnmarshalOptions type provides more control over wire unmarshaling.
31//
Joey Armstrongba3d9d12024-01-15 14:22:11 -050032// # Basic message operations
khenaidoo5fc5cea2021-08-11 17:39:16 -040033//
34// • Clone makes a deep copy of a message.
35//
36// • Merge merges the content of a message into another.
37//
38// • Equal compares two messages. For more control over comparisons
39// and detailed reporting of differences, see package
40// "google.golang.org/protobuf/testing/protocmp".
41//
42// • Reset clears the content of a message.
43//
44// • CheckInitialized reports whether all required fields in a message are set.
45//
Joey Armstrongba3d9d12024-01-15 14:22:11 -050046// # Optional scalar constructors
khenaidoo5fc5cea2021-08-11 17:39:16 -040047//
48// The API for some generated messages represents optional scalar fields
49// as pointers to a value. For example, an optional string field has the
50// Go type *string.
51//
52// • Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, and String
53// take a value and return a pointer to a new instance of it,
54// to simplify construction of optional field values.
55//
56// Generated enum types usually have an Enum method which performs the
57// same operation.
58//
59// Optional scalar fields are only supported in proto2.
60//
Joey Armstrongba3d9d12024-01-15 14:22:11 -050061// # Extension accessors
khenaidoo5fc5cea2021-08-11 17:39:16 -040062//
63// • HasExtension, GetExtension, SetExtension, and ClearExtension
64// access extension field values in a protocol buffer message.
65//
66// Extension fields are only supported in proto2.
67//
Joey Armstrongba3d9d12024-01-15 14:22:11 -050068// # Related packages
khenaidoo5fc5cea2021-08-11 17:39:16 -040069//
70// • Package "google.golang.org/protobuf/encoding/protojson" converts messages to
71// and from JSON.
72//
73// • Package "google.golang.org/protobuf/encoding/prototext" converts messages to
74// and from the text format.
75//
76// • Package "google.golang.org/protobuf/reflect/protoreflect" provides a
77// reflection interface for protocol buffer data types.
78//
79// • Package "google.golang.org/protobuf/testing/protocmp" provides features
80// to compare protocol buffer messages with the "github.com/google/go-cmp/cmp"
81// package.
82//
83// • Package "google.golang.org/protobuf/types/dynamicpb" provides a dynamic
84// message type, suitable for working with messages where the protocol buffer
85// type is only known at runtime.
86//
87// This module contains additional packages for more specialized use cases.
88// Consult the individual package documentation for details.
89package proto