anyvendor

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0

README

anyvendor

anyvendor is an all purpose dependency management tool originally created to manage vendoring protobuf files. However, it can also handle any non-language specific files available through it's multiple gathering mechanisms.

configuration

anyvendor is currently only available as a library, but the plan is to turn it into a standalone tool.

To use anyvendor create a new anyvendor manager by calling NewManager() and supplying the working directory of the project. anyvendor is meant to work at any level of a repo/project, so therefore the working directory must be supplied. Then the Ensure function can be called to vendor in all of the deps. The api for the Ensure function is reflected in the anyvendor.proto file in this directory.

Currently only gomod style dependencies are enabled, but git repo ones are coming soon.

Examples
  • local
local:
    patterns:
    - **/*.proto

a local config can be added to any config which will vendor files directly from the current directory into the corresponding vendor directory

  • gomod
imports:
    goMod:
      package: github.com/solo-io/solo-kit 
      patterns:
      - api/**/*.proto

The package is the name of the gomod package which anyvendor will search for the files. It will call go list -m all to find the correct version, and then search the local go mod cache for it. In order to use a package which is not explicitly required by any go projects, it can be brought in using the tools.go pattern. More information on tools in go mod can be found here.

caveat: the gomod style dependency will only work if the package is specified in the list of required packages for a given gomod package.

  • git repo: (coming soon)

building

Currently only involves regenerating the proto, which can be done with go generate .

Directories

Path Synopsis
pkg
git
manager/mocks
Package mock_manager is a generated GoMock package.
Package mock_manager is a generated GoMock package.

Jump to

Keyboard shortcuts

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