Giter VIP home page Giter VIP logo

go-genproto's Introduction

Go generated proto packages

GoDoc

go get google.golang.org/genproto/...

WARNING(2023-05-26): New submodules: upgrade before 2024-03-01 to avoid ambiguous import errors with google.golang.org/genproto. See #1015 for more information.

IMPORTANT This repository is currently experimental. The structure of the contained packages is subject to change. Please see the original source repositories (listed below) to find out the status of the each protocol buffer's associated service.

This repository contains the generated Go packages for common protocol buffer types, and the generated gRPC code necessary for interacting with Google's gRPC APIs.

The sources for the proto files used in this repository:

  • googleapis/googleapis: the code in the googleapis is derived from this repo. The packages here contain types specifically for interacting with Google APIs.

Historically, the packages in the protobuf directory used to contain generated code for certain well-known types hosted by google/protobuf. These types are now hosted by the google.golang.org/protobuf module and type aliases are used to forward declarations in this module over to declarations in the protobuf module.

go-genproto's People

Contributors

0xsage avatar admtnnr avatar ananyasaxena avatar bhshkh avatar broady avatar codyoss avatar davidcavazos avatar dependabot[bot] avatar doroginin avatar dsnet avatar google-cloud-policy-bot[bot] avatar guokeno0 avatar hengfengli avatar hongalex avatar igorbernstein2 avatar jba avatar jeanbza avatar larryxiao avatar liggitt avatar noahdietz avatar okdave avatar olavloite avatar pongad avatar quartzmo avatar renovate-bot avatar tamird avatar tbpg avatar tristonianjones avatar tritone avatar yoshi-automation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-genproto's Issues

Add tagged releases

Hi! I have a transitive dependency on go-genproto by way of gRPC. I'm bringing my project up-to-date to use Go modules, and I'm finding that it's hard to reason about what version of go-genproto I'm using because there are no tagged releases.

Go has officially adopted semantic versioning, with tags like v1.2.3. Would you consider adding such tags for go-genproto?

Unknown field 'Filename'

Hello,
When I try to test the bigquery in the project cloud.google.com/go/bigquery in version 0.16.0 it fails with

google.golang.org/genproto/googleapis/api/annotations

/usr/share/gocode/src/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go:40: unknown field 'Filename' in struct literal of type proto.ExtensionDesc
FAIL cloud.google.com/go/bigquery [build failed]

I have already install the project "go-genproto" in the commit 891aceb

Thank you for your help

Please sync google/api/http.proto from github.com/googleapis/googleapis

Recent regeneration commits have steamrolled over response_body field required for grpc-ecosystem/grpc-gateway#712.

This seems because the http.proto not based on the last http.proto. It was overwritten in 9739b9a.

Formerly-internal-only response_body has been made public in this sync commit googleapis/googleapis@3544ab1

https://github.com/googleapis/api-common-protos has not been synced for months (since July).

Can someone make sure that 3544ab16c3342d790b00764251e348705991ea4b makes it into the regenerated file?

Add a copyright / notice file

This project doesn't appear to include any copyright information or a NOTICE file. Can you add one? This is desired to comply with the open source license conditions.

release a version?

Hello~community maintainer:
the comminity has not released a version for a long time, can you release a version?

Version this repository

This PR is effectively a breaking change since it is incompatible with the v1.2 protoc toolchain.

Obviously there's nothing you can do about that, but it would be helpful if this repository was tagged with semantic versions so users can more sanely manage dependencies, particularly in light of newer dependency-management tools like dep and go modules.

Support for request latency

Hi,

We are using the logging api and have found that we are unable to attach a request latency to the HttpRequest proto message that is sent along with a specific log. https://github.com/google/go-genproto/blob/master/googleapis/logging/type/http_request.pb.go#L35

Compared to how AppEngine logs work in the system, it would be great if we could send along the latency of each request that we serve and have it display in the UI. We are already using the metadata to include the latency, but it requires the person to expand out the metadata for every request log that they want to see.

Thanks,
Braden

compile error

go: /usr/local/go/bin/go
git: /usr/bin/git
protoc: /usr/bin/protoc
protoc-gen-go: /go/bin/protoc-gen-go
warning: "google.golang.org/genproto/..." matched no packages
cannot find root of google.golang.org/genproto

I clone source code into $GOPATH/srt/github.com/, but got above error.
google.golang.org is an old directory? Need I make a new one?

Add bazelbuild/remote-apis protos

The Remote Execution API (REAPI) is a gRPC+protobuf protocol that Bazel (but not only) uses to distribute build and test actions across multiple machines. The protos are currently hosted in a separate repo from the core googleapis: remote-apis. Would be nice to add it as a proto source to go-genproto: that would make it easier for Go developers to use that API.

Build process should include /src suffix in PROTOBUF path

It looks like the automated build process for this repo overrides the PROTOBUF variable in regen.sh but does not include the /src suffix.

This results in the RegisterFile calls including src/ and breaks reflection/grpc_cli unless you change all your imports to also include src/ (ex: import "src/google/protobuf/field_mask.proto";).

honnef.co/go/tools (for CI) is pulled into user’s module dependency graph via go.mod

I’m upgrading an older project of mine to a newer version of google.golang.org/genproto and noticed that a number of new dependencies are coming in via the honnef.co/go/tools edge:

% go list -m all | wc -l
46
% go get -u honnef.co/go/tools
go: honnef.co/go/tools upgrade => v0.0.1-2020.1.3
% go list -m all | wc -l
53

The only reason why Go module honnef.co/go/tools is in my dependency closure at all is because genproto’s go.mod pulls it in, which is because tools.go pulls it in:

_ "honnef.co/go/tools/cmd/staticcheck"

I appreciate what tools.go is trying to do, and versioning the tools used in your CI pipeline is a good idea.

Ideally this could be done without burdening users of genproto with these module dependencies, though.

cc @bcmills in case he has any tips for how to change this

proto.InternalMessageInfo is undefined

Hi,

One of my project dependencies depends on your library's master, and now my build is broken with the following error message:

../../vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go:111:28:
undefined: proto.InternalMessageInfo

I'm using dep.

Please advise.

Many thanks.

EmbeddedAssistantClient.Assist errors out saying not enough argument.

i have been trying out the following snippet.

according to the signature context can be the only argument. somehow it errors out everytime.

pool, _ := x509.SystemCertPool()

creds := credentials.NewClientTLSFromCert(pool, "embeddedassistant.googleapis.com")

perRPC, _ := oauth.NewServiceAccountFromFile("/path/to/credentials.json")
conn, err := grpc.Dial(conf.AssistantEndpoint, grpc.WithTransportCredentials(creds),grpc.WithPerRPCCredentials(perRPC))

if err != nil {
	// fatal
	fmt.Println(err)
	os.Exit(1) 
}

Assistant := embedded.NewEmbeddedAssistantClient(conn)

assistStream, err := s.Assistant.Assist(ctx) // ERRORS OUT HERE SAYING NOT ENOUGH ARGUMENT

if err != nil {
	fmt.Println(err)
	return err
}

thanks.

Can't use go get -u on this module with its current latest pseudo-version

This module is currently affected by an issue similar to openzipkin/zipkin-go#114. It can be reproduced with Go 1.12 as follows:

$ export GO111MODULE=on
$ cd $(mktemp -d)
$ go mod init m
go: creating new go.mod: module m
$ go get -u google.golang.org/genproto
...
go: finding github.com/golang/lint latest
go: github.com/golang/[email protected]: parsing go.mod: unexpected module path "golang.org/x/lint"
...
go get: error loading module requirements
$ echo $?
1

To resolve this for this repository, its go.mod file needs to be updated to include newer versions of dependencies, in order to avoid pulling in older module versions that cause this conflict.

I haven't looked into the exact cause for this repo yet. It might be just a matter of waiting for golang/go#30833 to be resolved. I'll investigate more later.

/cc @broady @bcmills

json fields in dialogflow webhook messages need to be in lower camel case

Webhook Request messages send by dialogflow (see 'Sample Request to the Service" at https://dialogflow.com/docs/fulfillment) use keys with lower camel case but the json value in the protobuf generated files (see https://github.com/google/go-genproto/blob/master/googleapis/cloud/dialogflow/v2/webhook.pb.go) defines the json field names as underlined words. For example Dialogflow request message sends "queryResult" but in the json definition it is "query_result".

This mismatch causes issues when a RESTful webhook handler tries to decode received JSON message to the WebhookRequest struct.

unknown field "Filename' in struct literal of type proto.ExtensionDesc

When I try to compile this, I get the following error:

external/org_golang_google_genproto/googleapis/api/annotations/annotations.pb.go:41: unknown field 'Filename' in struct literal of type proto.ExtensionDesc

I'm using bazel. Building this because it is a dependency of github.com/grpc-ecosystem/grpc-gateway

Missing module line in go.mod?

Hi, I was trying to go get -u github.com/golang/protobuf/protoc-gen-go and the following error occured:
go: google.golang.org/[email protected]: parsing go.mod: missing module line go get: error loading module requirements

Im not sure what is causing this, but the version seems to indicate that this is a very recent version of genproto.

Service Unavailable Error for `func (x *speechStreamingRecognizeClient) Recv()`

I'm currently using the streaming API from the Google Cloud Speech To Text Golang client library. When I'm trying to Send(*StreamingRecognizeRequest), it has got no issue. But when I tried to use the Recv() (*StreamingRecognizeResponse, error) method from type Speech_StreamingRecognizeClient interface, it returns the error "rpc error: code = Unavailable desc = The service is currently unavailable."

google/protobuf/ moved to wrong place

#267 (comment)

This CL has changed the path of google/protobuf/field_mask.proto (and couple more files) in the proto registry to src/google/protobuf/field_mask.proto (which no longer matches its import path in *.proto, import "google/protobuf/field_mask.proto")

How do I use go-genproto to write a gRPC client to one of google's services?

I'm not sure what go-genproto does. Say I'm interested in writing a gRPC client application that targets one of google's services, and I don't want to have to download that service's protobuf, and all its imported protobufs, then protoc-gen-go these protobuf files to get generated go code I can import in my app.

Is this what go-genproto does for me?

I go get google.golang.org/genproto/.... That pulls the go-genproto module. Then what? How do I use that module in my application? Do I need to protoc-gen-go something or is the simple act of go get go-genproto taking care of this?

In my application, how do I import a given google service, what's the exact import url?

google.rpc.Status does not implement protoreflect.ProtoMessage

Hello.
After migrating from github.com/golang/[email protected] to google.golang.org/[email protected], I get an error when trying to make unmarshal google.rpc.Status.

cannot use &s (type *"google.golang.org/genproto/googleapis/rpc/status".Status) as type protoreflect.ProtoMessage in argument to protojson.Unmarshal:
	*"google.golang.org/genproto/googleapis/rpc/status".Status does not implement protoreflect.ProtoMessage (missing ProtoReflect method)

Maybe it is worth regenerating structures?

Multichannel Audio Support for Go Speech API Client

I am looking at this file: go-genproto/googleapis/cloud/speech/v1/cloud_speech.pb.go. I am wondering why the Go API client for Speech does not support fields like AudioChannelCount and EnableSeparateRecognitionPerChannel in type RecognitionConfig struct

Fix package names

There are many packages that do not end in the same name as its import path.

For example:

package google_type // import "google.golang.org/genproto/googleapis/type/latlng"

Not sure what to do about ones like appengine/v1, should they be package appengine or package v1?

Update bigtable protos

Hi,

I was wondering if someone could point me in the right direction as to how to regenerate protos? I recently updated the Bigtable protos which are now available on googleapis:
googleapis/googleapis@546d3a

But am unsure how to trigger an "update from googleapis" in this repo.

Thanks!

Error while running go .. (full command)

Go fails by saying unknown error occurred. Do it have something to with protobuf dependencies?
Please resolve.

go get google.golang.org/genproto/... is failing by Unknown Error Occured.

Go version : 1.8.
OS : Parrot OS (Unix Kernel 4+).

Using go-cli.

I am already working on the resolution. If possible, do update me incase I am missing out on something.

recommendationengine: reenable generation of v1beta1

There is currently an issue with this library including the following import:_ "google/cloud/recommendationengine/v1beta1"

Blocking generation of this client until issues are resolved so that other clients can re-gen.

Asset.Resource.Data is empty after json.Unmarshal

When reading a asset from a file or inline after json.Unmarshal the Asset.Resource.Data is empty even if the JSON is not:

package main

import (
	"encoding/json"
	"io/ioutil"
	"log"

	"google.golang.org/genproto/googleapis/cloud/asset/v1"
)

func main() {
	file, err := ioutil.ReadFile("asset.json")
	if err != nil {
		log.Panic(err)
	}

	var myAsset asset.Asset
	err = json.Unmarshal(file, &myAsset)
	if err != nil {
		log.Panic(err)
	}
	log.Printf("%v", myAsset.Resource)
}

With asset.json is

{
  "name": "//cloudresourcemanager.googleapis.com/projects/123456789012",
  "asset_type": "cloudresourcemanager.googleapis.com/Project",
  "resource": {
    "version": "v1",
    "discovery_document_uri": "https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v1",
    "discovery_name": "Project",
    "parent": "//cloudresourcemanager.googleapis.com/folders/234567890121",
    "data": {
      "createTime": "2018-08-08T08:04:36.279Z",
      "labels": {
        "env": "dev",
        "product": "my"
      },
      "lifecycleState": "ACTIVE",
      "name": "my-project",
      "parent": {
        "id": "234567890121",
        "type": "folder"
      },
      "projectId": "my-project-id",
      "projectNumber": "123456789012"
    }
  },
  "ancestors": [
    "projects/123456789012",
    "folders/234567890121",
    "organizations/345678901212"
  ]
}

Acutal behaviour

$ go run main.go
2020/05/13 11:08:59 version:"v1" discovery_document_uri:"https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v1" discovery_name:"Project" parent:"//cloudresourcemanager.googleapis.com/folders/234567890121" data:<> 

Expected behaviour

data should contain the information about from the json data block.

Fail to build

I'm having trouble building, got this error:

package google.golang.org/genproto/googleapis/type: no buildable Go source files in /go/src/google.golang.org/genproto/googleapis/type

Anyone has the same problem?

b3e7c2 appears to create compatibility issue with github.com/golang/protobuf/descriptor

https://github.com/golang/protobuf/blob/master/descriptor/descriptor.go imports google.golang.org/genproto/protobuf which as of b3e7c2f contains no buildable go files (and further, removes expected types).

$ go install github.com/golang/protobuf/descriptor
../../github.com/golang/protobuf/descriptor/descriptor.go:46:2: no buildable Go source files in ${GOPATH}/src/google.golang.org/genproto/protobuf

Should this be filed against github.com/golang/protobuf instead?

Support google/protobuf/compiler/plugin.proto

I would be great if this repository also contains a compiled version of google/protobuf/compiler/plugin.proto.

I expect that this repository contains the proto because it is a part of protoc distribution. So it should be common enough to store in this repository.

Currently I am using github.com/golang/protobuf/protoc-gen-go/plugin as a compiled version of the proto file but unfortunately that go package cannot coexist with google.golang.org/genproto/protobuf because both have their own instances of descriptor.proto and they collide with each other at runtime.

undefined: proto".ProtoPackageIsVersion4

glide.yml

package: ...
import:
- package: github.com/golang/protobuf
  version: ~1.3.0
  subpackages:
  - protoc-gen-go
- package: github.com/google/protobuf
  version: ~3.11.0
- package: google.golang.org/grpc
  version: ~1.27.0
- package: github.com/gogo/protobuf
  version: ~1.3.0
- package: github.com/mwitkow/go-proto-validators
- package: github.com/grpc-ecosystem/go-grpc-middleware
  version: ~1.2.0

makefile

.PHONY: build

build:
	go install ./vendor/github.com/golang/protobuf/protoc-gen-go
	go install ./vendor/github.com/mwitkow/go-proto-validators/protoc-gen-govalidators

	protoc \
	--go_out=plugins=grpc:. \
	--govalidators_out=. \
	--proto_path=. \
	--proto_path=./vendor \
	--proto_path=./vendor/github.com/google/protobuf/src \
	*.proto

Recently, I could not build my protobuf package well. It works fine before.
Terminal shows message below:

vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go:42:11: undefined: "{{PATH_TO_PACKAGE}}/vendor/github.com/golang/protobuf/proto".ProtoPackageIsVersion4

And "ProtoPackageIsVersionX" in proto.go is "ProtoPackageIsVersion3"

Does it means that I must upgrade "github.com/golang/protobuf" to v1.4.0?

CI process to integrate the generated go stubs from protobuf types to this repository

Hi!

So this is not actually an issue. I was just wondering how it works the whole process of integrating the generated go stubs from googleapis/api-common-protos to this repository.

The thing is that in my company we also have a main common repository which we have some protobuf types. We want to automate our CI to generate the stubs in go, dart, c#, etc. to separate repositores, just like it works in this repo.

I searched into the code and studied for a while to try to understand better what is going on. I see that there is a google bot that creates a PR whenever there is a merge into the protobuf source repo. Is this something related to the artman tool? Or maybe some ready solution like a github action?

@codyoss could you help?

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.