Skip to content

Commit 0651fe0

Browse files
Protocol Buffer TeamLogofile
authored andcommitted
Project import generated by Copybara.
PiperOrigin-RevId: 480154650 Change-Id: Ic47927d1261dc019ba74f84fd2c66911e1db73ea
1 parent e4b85b1 commit 0651fe0

File tree

613 files changed

+351277
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

613 files changed

+351277
-1
lines changed

content/docs/_index.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: "Protocol Buffers"
3+
weight: 5
4+
toc_hide: true
5+
linkTitle: "Protocol Buffers"
6+
no_list: "true"
7+
type: docs
8+
---
9+
10+
11+
12+
13+
<style>
14+
.row .highlight {
15+
margin-top: 2rem;
16+
margin-right: 0;
17+
margin-bottom: 0;
18+
margin-left: 0;
19+
padding: 0;
20+
}
21+
</style>
22+
23+
<div class="row">
24+
<div class="col-md">
25+
26+
```proto
27+
message Person {
28+
optional string name = 1;
29+
optional int32 id = 2;
30+
optional string email = 3;
31+
}
32+
```
33+
34+
<p class="caption">A proto definition.</>
35+
</div>
36+
<div class="col-md">
37+
38+
```proto
39+
Person john = Person.newBuilder()
40+
.setId(1234)
41+
.setName("John Doe")
42+
.setEmail("[email protected]")
43+
.build();
44+
output = new FileOutputStream(args[0]);
45+
john.writeTo(output);
46+
47+
```
48+
49+
<p class="caption">Using a generated class to persist data.</p>
50+
</div>
51+
<div class="col-md">
52+
53+
```proto
54+
Person john;
55+
fstream input(argv[1],
56+
ios::in | ios::binary);
57+
john.ParseFromIstream(&input);
58+
id = john.id();
59+
name = john.name();
60+
email = john.email();
61+
62+
```
63+
64+
<p class="caption">Using a generated class to parse persisted data.</p>
65+
</div>
66+
</div>
67+
<div class="row">
68+
<div class="col-md">
69+
70+
## What Are Protocol Buffers?
71+
72+
Protocol buffers are Google's language-neutral, platform-neutral, extensible
73+
mechanism for serializing structured data – think XML, but smaller, faster, and
74+
simpler. You define how you want your data to be structured once, then you can
75+
use special generated source code to easily write and read your structured data
76+
to and from a variety of data streams and using a variety of languages.
77+
78+
</div>
79+
<div class="col-md">
80+
81+
## Pick Your Favorite Language
82+
83+
Protocol buffers currently support generated code in Java, Python, Objective-C,
84+
and C++. With our new proto3 language version, you can also work with Kotlin,
85+
Dart, Go, Ruby, PHP, and C#, with more languages to come.
86+
87+
</div>
88+
<div class="col-md">
89+
90+
## How Do I Start?
91+
92+
<ol>
93+
94+
<li>
95+
<a href="https://github.com/protocolbuffers/protobuf#protocol-compiler-installation">Download
96+
and install</a> the protocol buffer compiler.
97+
</li>
98+
99+
<li>
100+
Read the
101+
<a href="/docs/overview">overview</a>.
102+
</li>
103+
<li>
104+
Try the <a href="/docs/getting-started">tutorial</a> for your
105+
chosen language.
106+
</li>
107+
</ol>
108+
109+
</div>
110+
</div>

content/docs/contributing.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: "Contributing"
3+
weight: 1030
4+
toc_hide: false
5+
linkTitle: "Contributing"
6+
no_list: "true"
7+
type: docs
8+
---
9+
10+
If you're interested in contributing to the protocol buffers project, read about
11+
the following scenarios.
12+
13+
## Can I Add Support for a New Language to Protocol Buffers? {#contribute-language}
14+
15+
Yes! In fact, the protocol buffer compiler is designed such that it's easy to
16+
write your own compiler. Check out the `CommandLineInterface` class, which is
17+
available as part of the `libprotoc` library.
18+
19+
We encourage you to create code generators and runtime libraries for new
20+
languages. You should start your own, independent project for this&mdash;this
21+
way, you will have the freedom to manage your project as you see fit, and will
22+
not be held back by our release process. Join the
23+
[protocol buffers discussion group](http://groups.google.com/group/protobuf) and
24+
let us know about your project; we will be happy to link to it and help you out
25+
with design issues.
26+
27+
## Can I Contribute Patches to Protocol Buffers? {#patches}
28+
29+
Yes! Join the
30+
[protocol buffers discussion group](http://groups.google.com/group/protobuf) and
31+
talk to us about it.
32+
33+
## Can I Add New Features to Protocol Buffers? {#new-features}
34+
35+
Maybe. We always like suggestions, but we're very cautious about adding things.
36+
One thing we've learned over the years is that lots of people have interesting
37+
ideas for new features. Most of these features are very useful in specific
38+
cases, but if we accepted all of them, protocol buffers would become a bloated,
39+
confusing mess. So, we have to be very picky. When evaluating new features, we
40+
look for additions that are very widely useful or very simple&mdash;or hopefully
41+
both. We regularly turn down feature additions from Google employees. We even
42+
regularly turn down feature additions from our own team members.
43+
44+
That said, we'd still like to hear what you have in mind. Join the
45+
[protocol buffers discussion group](http://groups.google.com/group/protobuf) and
46+
let us know. We might be able to help you find a way to do what you want without
47+
changing the underlying library. Or, maybe we'll decide that your feature is so
48+
useful or so simple that it should be added.

content/docs/downloads.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "Downloads"
3+
weight: 1000
4+
toc_hide: false
5+
linkTitle: "Downloads"
6+
no_list: "true"
7+
type: docs
8+
---
9+
10+
## Release Packages
11+
12+
### Latest Version
13+
14+
The latest release of Protocol Buffers can be found on the
15+
[release page](https://github.com/protocolbuffers/protobuf/releases/latest).
16+
17+
### Old Versions
18+
19+
Older versions are available in our historical releases
20+
[on GitHub](https://github.com/protocolbuffers/protobuf/releases).
21+
22+
## Source Code
23+
24+
### GitHub Repository
25+
26+
Protocol Buffers source code is hosted on
27+
[GitHub](https://github.com/protocolbuffers/protobuf).

content/docs/forum-link.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Forum"
3+
manualLink: "https://groups.google.com/g/protobuf"
4+
manualLinkTarget: "_blank"
5+
weight: 1040
6+
---
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: "Tutorials"
3+
weight: 200
4+
toc_hide: false
5+
linkTitle: "Tutorials"
6+
no_list: "true"
7+
type: docs
8+
---
9+
10+
Each tutorial in this section shows you how to implement a simple application
11+
using protocol buffers in your favourite language, introducing you to the
12+
language's protocol buffer API as well as showing you the basics of creating and
13+
using .proto files. The complete sample code for each application is also
14+
provided.
15+
16+
The tutorials don't assume that you know anything about protocol buffers, but do
17+
assume that you are comfortable writing code in your chosen language, including
18+
using file I/O.
19+
20+
* [C++](/docs/getting-started/cpptutorial)
21+
* [C#](/docs/getting-started/csharptutorial)
22+
* [Dart](/docs/getting-started/darttutorial)
23+
* [Go](/docs/getting-started/gotutorial)
24+
* [Java](/docs/getting-started/javatutorial)
25+
* [Kotlin](/docs/getting-started/kotlintutorial)
26+
* [Python](/docs/getting-started/pythontutorial)

0 commit comments

Comments
 (0)