Giter Site home page Giter Site logo

singchia / api-common-protos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googleapis/api-common-protos

0.0 1.0 0.0 355 KB

A standard library for use in specifying protocol buffer APIs.

Home Page: https://cloud.google.com/apis/design/

License: Apache License 2.0

Python 4.77% Dockerfile 2.45% Starlark 92.77%

api-common-protos's Introduction

Common Protos

release level

This repository is a home for the protocol buffer types which are common dependencies throughout the Google API ecosystem, and which are made available for use as dependencies elsewhere.

About protocol buffers

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data โ€“ think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.

One popular use for protocol buffers, both within Google and elsewhere, is for specifying API design. They serve as a useful representation for API serivices, methods, and fields. You can read more about API design philosophy with protocol buffers by consulting our API Design Guide.

Why a common protos repository?

When writing protocol buffers, it is common to need to reuse common patterns. For example, common types show up in many different APIs, but have a consistent implementation. The same is true elsewhere.

This repository seeks to be a home for such types; protocol buffer authors may check out this repository and import them into their own work to save effort.

The protos in the various subdirectories in this repository have different purposes, and are documented in their respective README files.

Using these protos

NOTE The protos in this repository are not updated automatically and may be outdated. Please look to the protos in googleapis/googleapis instead which are updated regularly.

These protos are made available under an Apache license (see LICENSE) and you are free to depend on them within your applications. They are considered stable and will not change in backwards-incompaible ways.

In order to depend on these protos, use proto import statements that reference the base of this repository, for example:

syntax = "proto3";

import "google/type/color.proto";


// A message representing a paint can.
message PaintCan {
  // The size of the paint can, in gallons.
  float size_gallons = 1;

  // The color of the paint.
  google.type.Color color = 2;
}

If you are using protoc (or other similar tooling) to compile these protos yourself, you will likely require a local copy. Clone this repository to a convenient location and use --proto_path to specify the root of this repository on your machine to the compiler.

Packages

Additionally, if using these common protos, it is not necessary to ship the compiled types yourself in many common languages. Google provides a common protos package in several languages, which can be added as a dependency, and which makes these types available.

Note that if using these packages, you will still need a local copy of these protos when using protoc, but you will not need to ship compiled versions of them. (This is consistent with protoc's default behavior of only providing compiled output for the files specifically requested, and not their imports.)

google.protobuf types (separate from this repo)

There are a small number of types that are so common that they are included in the actual protocol buffers runtime itself. These are anything with an import path beginning with google/protobuf/, and notably includes timestamps and durations.

These are not defined in this directory, and you do not need to follow any of the instructions for including this (as discussed in the root README file) if you want to use those. They are part of protocol buffers, and an import of those will "just work". These are colloquially referred to as "well-known types".

Disclaimer

These protos are made available by Google, but are not considered to be an official Google product.

License

These protos are licensed using the Apache 2.0 software license, a permissive, copyfree license. You are free to use them in your applications provided the license terms are honored.

api-common-protos's People

Contributors

googleapis-publisher avatar ethanbao avatar software-dov avatar lukesneeringer avatar garrettjonesgoogle avatar noahdietz avatar geigerj avatar renovate-bot avatar viacheslav-rostovtsev avatar landrito avatar michaelbausor avatar google-cloud-policy-bot[bot] avatar pongad avatar justinbeckwith avatar yihanzhen avatar makdharma avatar kolea2 avatar guptasu avatar jcanizales avatar jskeet avatar iennae avatar ivucica avatar hypnoglow avatar wora avatar eoogbe avatar dazuma avatar carl-mastrangelo avatar parthea avatar alexander-fenster avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.