api

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 9 Imported by: 0

README

Vulcan Results Service

Requirements

  • go 1.13.x

Build & Install

GO111MODULE=on go get github.com/adevinta/vulcan-results/cmd/vulcan-result

Build, regenerate code from Goa DSL & install in a Docker container

docker run -ti golang:1.13-alpine /bin/sh
apk add git
# Cloning out of the GOPATH
cd /tmp
git clone git://github.com/adevinta/vulcan-results.git
cd vulcan-results
go mod download
go install github.com/goadesign/goa/goagen
sh clean.sh
sh build.sh

Config file example:

config-example.toml

# File where result logs are stored.
# Leave empty (or remove) for STDOUT.
LogFile = ""
Port = 8888
Debug = true

[Storage]
Region = "eu-west-1"
BucketVulnerableReports = "my-vulnerable-reports-bucket"
BucketReports = "my-reports-bucket"
BucketLogs = "my-check-logs-bucket"
LinkBase = "http://example.com/v1"

Run

$GOPATH/bin/vulcan-results /path/to/config-example.toml

Docker execute

Those are the variables you have to use:

Variable Description Sample
PORT Listen http port 8080
DEBUG true
AWS_REGION aws region eu-west-1
BUCKET_REPORTS Bucket name to store reports bucket-reports
BUCKET_LOGS Buckent name to store logs bucket-logs
LINK_BASE URL used for TBD http://results/v1
docker build . -t vr

# Use the default config.toml customized with env variables.
docker run --env-file ./local.env vr

# Use custom config.toml
docker run -v `pwd`/custom.toml:/app/config.toml vr

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Scan *Scan `json:"scan"`
}

type CheckPatchLogs

type CheckPatchLogs struct {
	Raw *string `json:"raw"`
}

type CheckPatchReport

type CheckPatchReport struct {
	Report *string `json:"report"`
}

type HealthcheckController

type HealthcheckController struct {
	*goa.Controller
}

HealthcheckController implements the healthcheck resource.

func NewHealthcheckController

func NewHealthcheckController(service *goa.Service) *HealthcheckController

NewHealthcheckController creates a healthcheck controller.

func (*HealthcheckController) Show

Show runs the show action.

type ResultsController

type ResultsController struct {
	*goa.Controller
	// contains filtered or unexported fields
}

ResultsController implements the Results resource.

func NewResultsController

func NewResultsController(service *goa.Service, s storage.Storage) *ResultsController

NewResultsController creates a Results controller.

func (*ResultsController) GetLog

GetLog runs the getLog action.

func (*ResultsController) GetReport

GetReport runs the getReport action.

func (*ResultsController) Raw

Raw runs the raw action.

func (*ResultsController) Report

Report runs the report action.

type Scan

type Scan struct {
	ID        *string   `json:"id"`
	CreatedAt time.Time `json:"created_at"`
}

Directories

Path Synopsis
app
cmd
tool
cli

Jump to

Keyboard shortcuts

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