All deps-cloud API definitions consolidated into a single repostory. This repository currenlty produces 2 libraries:
- npm: @deps-cloud/api
- vgo: github.com/deps-cloud/api
To install:
npm install --save @deps-cloud/api
Usage:
const grpc = require('grpc');
const { DependencyExtractor } = require('@deps-cloud/api/v1alpha/extractor');
const {
SourceService,
ModuleService,
DependencyService,
} = require('@deps-cloud/api/v1alpha/tracker');
const credentials = grpc.credentials.createInsecure();
const dependencyExtractor = new DependencyExtractor('address', credentials);
const sourceService = new SourceService('address', credentials);
const moduleService = new ModuleService('address', credentials);
const dependencyService = new DependencyService('address', credentials);
To install:
go get -u github.com/deps-cloud/api
Usage:
package main
import (
"github.com/deps-cloud/api/v1alpha/extractor"
"github.com/deps-cloud/api/v1alpha/tracker"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)
func dial(target string) *grpc.ClientConn {
cc, _ := grpc.Dial(target, grpc.WithBlock(), grpc.WithInsecure())
return cc
}
func main() {
dependencyExtractor := extractor.NewDependencyExtractorClient(dial("address"))
sourceService := tracker.NewSourceServiceClient(dial("address"))
moduleService := tracker.NewModuleServiceClient(dial("address"))
dependencyService := tracker.NewDependencyServiceClient(dial("address"))
}
I've provided a docker container that encapsulates the dependencies for regenerating the different language files.
docker run --rm -it \
-v $(pwd)/swagger:/go/src/github.com/deps-cloud/api/swagger \
-v $(pwd)/v1alpha:/go/src/github.com/deps-cloud/api/v1alpha \
depscloud/api-builder
You can quickly invoke this command using the make compile-docker
target.
NOTE: Changes to *.js
and *.d.ts
are done manually.
Currently evaluating code generation options.