protodep

command module
v0.0.0-...-f1df132 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

protodep

logo

GitHub Actions Language issues GoDoc go.mod

Dependency tool for Protocol Buffers IDL file (.proto) vendoring tool.

Motivation

In building Microservices architecture, gRPC with Protocol Buffers is effective. When using gRPC, your application will depend on many remote services.

If you manage proto files in a git repository, what will you do? Most remote services are managed by git and they will be versioned. We need to control which dependency service version that application uses.

Install

go install
$ go install github.com/hr3685930/protodep

Usage

protodep.toml

Proto dependency management is defined in protodep.toml.

proto_outdir = "./proto"

[[dependencies]]
  target = "github.com/hr3685930/protodep/protobuf"
  branch = "master"

[[dependencies]]
  target = "github.com/grpc-ecosystem/grpc-gateway/examples/examplepb"
  revision = "v1.2.2"
  path = "grpc-gateway/examplepb"

# blacklist by "ignores" attribute
[[dependencies]]
  target = "github.com/kubernetes/helm/_proto/hapi"
  branch = "master"
  path = "helm/hapi"
  ignores = ["./release", "./rudder", "./services", "./version"]
  
# whitelist by "includes" attribute
[[dependencies]]
  target = "github.com/protodep/catalog/hierarchy"
  branch = "main"
  includes = [
    "/protodep/hierarchy/service.proto",
    "**/fuga/**",
  ]
  protocol = "https"
protodep up

In same directory, execute this command.

$ protodep up

If succeeded, protodep.lock is generated.

protodep up -f (force update)

Even if protodep.lock exists, you can force update dependenies.

$ protodep up -f
[Attention] Changes from 0.1.0

From protodep 0.1.0 supports ssh-agent, and this is the default. In other words, in order to operate protodep without options as before, it is necessary to set with ssh-add.

As the follows:

$ ssh-add ~/.ssh/id_rsa
$ protodep up
Getting via HTTPS

If you want to get it via HTTPS, do as follows.

$ protodep up --use-https

And also, if Basic authentication is required, do as follows. If you have 2FA enabled, specify the Personal Access Token as the password.

$ protodep up --use-https \
    --basic-auth-username=your-github-username \
    --basic-auth-password=your-github-password
License

Apache License 2.0, see LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
auth
Package helper is a generated GoMock package.
Package helper is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL