protobuf README

The project's README from github.com/golang/protobuf. As one markdown file: README.md.

Go support for Protocol Buffers

GoDev Build Status

This module (github.com/golang/protobuf) contains Go bindings for protocol buffers.

It has been superseded by the google.golang.org/protobuf module, which contains an updated and simplified API, support for protobuf reflection, and many other improvements. We recommend that new code use the google.golang.org/protobuf module.

Versions v1.4 and later of github.com/golang/protobuf are implemented in terms of google.golang.org/protobuf. Programs which use both modules must use at least version v1.4 of this one.

See the developer guide for protocol buffers in Go for a general guide for how to get started using protobufs in Go.

See release note documentation for more information about individual releases of this project.

See documentation for the next major revision for more information about the purpose, usage, and history of this project.

Package index

Summary of the packages provided by this module:

Reporting issues

The issue tracker for this project is located here.

Please report any issues with a sufficient description of the bug or feature request. Bug reports should ideally be accompanied by a minimal reproduction of the issue. Irreproducible bugs are difficult to diagnose and fix (and likely to be closed after some period of time). Bug reports must specify the version of the Go protocol buffer module and also the version of the protocol buffer toolchain being used.

Contributing

This project is open-source and accepts contributions. See the contribution guide for more information.

Compatibility

This module and the generated code are expected to be stable over time. However, we reserve the right to make breaking changes without notice for the following reasons:

Any breaking changes outside of these will be announced 6 months in advance to [email protected].

protobuf (golang/protobuf)

Searching Database…

10.1K ·GitHub
Что это такое?Go-биндинги для протокола buffers от Google: модуль github.com/golang/protobuf для сериализации protobuf-сообщений в Go, а также плагин protoc, который генерирует Go-код из .proto-файлов.
Это библиотека, которую я подключаю, или утилита, которую я запускаю?И то, и другое. Вы подключаете Go-пакеты (proto, jsonpb, ptypes) в своём коде, а отдельно запускаете protoc-gen-go — бинарный плагин для компилятора protoc, чтобы сгенерировать свои Go-пакеты с сообщениями.
Как превратить .proto-файлы в Go-код?Запустите компилятор protoc с плагином protoc-gen-go; он сгенерирует Go-пакет protocol buffer из ваших .proto-описаний. В README есть ссылка на руководство для разработчиков по началу работы с protobuf в Go.
В README сказано, что этот модуль устарел — стоит ли мне им пользоваться?Для нового кода — нет: в README рекомендуется google.golang.org/protobuf, у которого обновлённый и упрощённый API, protobuf reflection и множество других улучшений. Этот модуль остаётся для кода, который уже его подключает.
Если я буду строить проект на этом модуле, насколько стабилен его API?Ожидается, что модуль и сгенерированный код останутся стабильными, но команда оставляет за собой право нарушить совместимость без предупреждения ради исправлений безопасности, изменений спецификации, исправления багов и внутренних изменений; о других несовместимых изменениях сообщают за 6 месяцев.
Мой код подключает и этот модуль, и новый — на что обратить внимание?Да: программы, использующие оба модуля, должны использовать как минимум версию v1.4 модуля github.com/golang/protobuf, поскольку версии с v1.4 и новее реализованы поверх google.golang.org/protobuf.
Что он умеет делать с моими сообщениями, кроме бинарной сериализации?Пакет proto также клонирует, объединяет и проверяет сообщения на равенство и записывает их в текстовом формате, а jsonpb сериализует protobuf-сообщения в JSON.
Для каких известных protobuf-типов есть вспомогательные пакеты?ptypes содержит вспомогательные функции для timestamp, duration, empty, any, wrappers и struct (structpb) — стандартных well-known типов google/protobuf.
Creator
golang
Size
8.2 MB
Stars
10.1K
Age
11y
Commits · 90 Days