api

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: MIT Imports: 2 Imported by: 0

README

api

All deps.cloud API definitions consolidated into a single repository. This repository currently produces 2 libraries:

Getting Started with NodeJS

To install:

npm install --save @depscloud/api

Usage:

const grpc = require('grpc');

const { DependencyExtractor } = require('@depscloud/api/v1alpha/extractor');
const {
    SourceService,
    ModuleService,
    DependencyService,
} = require('@depscloud/api/v1alpha/tracker');

const credentials = grpc.credentials.createInsecure();

const dependencyExtractor = new DependencyExtractor('gateway:80', credentials);
const sourceService = new SourceService('gateway:80', credentials);
const moduleService = new ModuleService('gateway:80', credentials);
const dependencyService = new DependencyService('gateway:80', credentials);

Getting Started with Go

To install:

go get -u github.com/depscloud/api

Usage:

package main

import (
    "github.com/depscloud/api/v1alpha/extractor"
    "github.com/depscloud/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("gateway:80"))
    sourceService := tracker.NewSourceServiceClient(dial("gateway:80"))
    moduleService := tracker.NewModuleServiceClient(dial("gateway:80"))
    dependencyService := tracker.NewDependencyServiceClient(dial("gateway:80"))
}

Recompiling Protocol Buffer Files

I've provided a docker container that encapsulates the dependencies for regenerating the different language files.

docker run --rm \
    -v $(PWD):/go/src/github.com/depscloud/api \
    depscloud/api-builder \
    bash scripts/compile.sh

You can quickly invoke this command using the make compile-docker target.

NOTE: Changes to *.js and *.d.ts are done manually. Evaluating code generation options.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrModuleNotFound occurs when a module cannot be found in the graph
	ErrModuleNotFound = status.Error(codes.NotFound, "failed to locate module")
	// ErrPartialDeletion occurs when a partial deletion occurs during Put
	ErrPartialDeletion = status.Error(codes.Internal, "failed to delete removed edges")
	// ErrPartialInsertion occurs when a partial insertion occurs during Put
	ErrPartialInsertion = status.Error(codes.Internal, "failed to insert new edges")
	// ErrUnimplemented occurs when a method has not yet been implemented
	ErrUnimplemented = status.Error(codes.Unimplemented, "unimplemented")
	// ErrUnsupported occurs when calling a rw method on a read only service
	ErrUnsupported = status.Error(codes.NotFound, "read only")
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package swagger generated by go-bindata.// sources: v1alpha/tracker/tracker.swagger.json v1alpha/extractor/extractor.swagger.json v1alpha/schema/schema.swagger.json v1alpha/deps/deps.swagger.json v1alpha/store/store.swagger.json
Package swagger generated by go-bindata.// sources: v1alpha/tracker/tracker.swagger.json v1alpha/extractor/extractor.swagger.json v1alpha/schema/schema.swagger.json v1alpha/deps/deps.swagger.json v1alpha/store/store.swagger.json
v1alpha
extractor
Package extractor is a reverse proxy.
Package extractor is a reverse proxy.
tracker
Package tracker is a reverse proxy.
Package tracker is a reverse proxy.

Jump to

Keyboard shortcuts

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