app

package
v0.0.0-...-04f754b Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const DifferenceMapping = `` /* 323-byte string literal not displayed */
View Source
const DifferenceProjectField = "project_name"
View Source
const DifferenceType = `difference`
View Source
const ESMapping = `
{
	"mappings": {
		"` + RepositoryEntryType + `": ` + types.ScanMapping + `,
		"` + DifferenceType + `": ` + DifferenceMapping + `,
		"` + RepositoryType + `": ` + types.RepositoryMapping + `,
		"` + ProjectType + `": ` + types.ProjectMapping + `
	}
}`
View Source
const ProjectType = `project`
View Source
const RepositoryEntryType = `repository_entry`
View Source
const RepositoryType = `repository`

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(index elasticsearch.IIndex, singleLocation, compareLocation, templateLocation string, debugMode bool) *Application

func (*Application) StartInternals

func (a *Application) StartInternals()

func (*Application) StartServer

func (a *Application) StartServer() chan error

func (*Application) Stop

func (a *Application) Stop()

type Back

type Back struct {
	BackButton string `form:"button_back"`
}

type CompareRunner

type CompareRunner struct {
	// contains filtered or unexported fields
}

func NewCompareRunner

func NewCompareRunner(app *Application) *CompareRunner

func (*CompareRunner) CompareRepositories

func (cr *CompareRunner) CompareRepositories(actual, expected com.DependencyScans) (string, error)

func (*CompareRunner) CompareStrings

func (cr *CompareRunner) CompareStrings(actual, expected string) (string, error)

type Difference

type Difference struct {
	Id          string    `json:"id"`
	RepoName    string    `json:"repo_name"`
	ProjectName string    `json:"project_name"`
	Ref         string    `json:"ref"`
	OldSha      string    `json:"old_sha"`
	NewSha      string    `json:"new_sha"`
	Removed     []string  `json:"removed"`
	Added       []string  `json:"added"`
	Timestamp   time.Time `json:"time"`
}

func (*Difference) SimpleString

func (d *Difference) SimpleString() string

type DifferenceManager

type DifferenceManager struct {
	CurrentDisplay string
	// contains filtered or unexported fields
}

func NewDifferenceManager

func NewDifferenceManager(app *Application) *DifferenceManager

func (*DifferenceManager) Delete

func (d *DifferenceManager) Delete(id string)

func (*DifferenceManager) GenerateReport

func (dm *DifferenceManager) GenerateReport(d *Difference) string

func (*DifferenceManager) GetAllDiffsInProject

func (d *DifferenceManager) GetAllDiffsInProject(proj string) (*[]Difference, error)

func (*DifferenceManager) ShaCompare

func (d *DifferenceManager) ShaCompare(repoName string, files []string, oldSha, newSha string) (*Difference, error)

type FireAndForget

type FireAndForget struct {
	// contains filtered or unexported fields
}

func NewFireAndForget

func NewFireAndForget(app *Application) *FireAndForget

func (*FireAndForget) FireGit

func (ff *FireAndForget) FireGit(git *s.GitWebhook)

func (*FireAndForget) FireRequest

func (ff *FireAndForget) FireRequest(request *SingleRunnerRequest)

type Project

type Project struct {
	*types.Project
	// contains filtered or unexported fields
}

func (*Project) GetAllRefs

func (p *Project) GetAllRefs() ([]string, error)

Test: TestGetRepositories

func (*Project) GetAllRepositories

func (p *Project) GetAllRepositories() ([]*Repository, error)

Test: TestAddRepositories

func (*Project) GetRepository

func (p *Project) GetRepository(repository string) (*Repository, error)

Test: TestGetRepositories

func (*Project) ScanBySha

func (p *Project) ScanBySha(sha string) (*types.Scan, bool, error)

Test: TestGetScans

func (*Project) ScansByRefInProject

func (project *Project) ScansByRefInProject(ref string) (map[string]*types.Scan, error)

type Repository

type Repository struct {
	*types.Repository
	// contains filtered or unexported fields
}

func (*Repository) GetAllRefs

func (r *Repository) GetAllRefs() ([]string, error)

Test: TestGetRepositories

func (*Repository) MapRefToShas

func (r *Repository) MapRefToShas() (map[string][]string, int64, error)

Returns map of refs to shas of a repository in a project

type Retriever

type Retriever struct {
	// contains filtered or unexported fields
}

func NewRetriever

func NewRetriever(app *Application) *Retriever

func (*Retriever) GetAllProjectNamesUsingRepository

func (r *Retriever) GetAllProjectNamesUsingRepository(repo string) ([]string, error)

Test: TestAddRepositories

func (*Retriever) GetAllProjects

func (r *Retriever) GetAllProjects() ([]*Project, error)

Test: TestAddProjects

func (*Retriever) GetProjectById

func (r *Retriever) GetProjectById(id string) (*Project, error)

Test: TestAddProjects

func (*Retriever) GetRepository

func (r *Retriever) GetRepository(repository, projectId string) (*Repository, *Project, error)

Test: TestAddRepositories

func (*Retriever) ListRepositories

func (r *Retriever) ListRepositories() ([]string, error)

Test: TestGetRepositories

func (*Retriever) ScanByShaNameGen

func (r *Retriever) ScanByShaNameGen(repo *Repository, sha string) (*types.Scan, error)

type SingleRunner

type SingleRunner struct {
	// contains filtered or unexported fields
}

func NewSingleRunner

func NewSingleRunner(app *Application) *SingleRunner

func (*SingleRunner) RunAgainstSingle

func (sr *SingleRunner) RunAgainstSingle(printHeader string, printLocation chan string, request *SingleRunnerRequest) *types.Scan

func (*SingleRunner) ScanWithSingle

func (sr *SingleRunner) ScanWithSingle(fullName string) ([]string, error)

type SingleRunnerRequest

type SingleRunnerRequest struct {
	// contains filtered or unexported fields
}

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(app *Application, numWorkers int) *Worker

func (*Worker) AddTask

func (w *Worker) AddTask(request *SingleRunnerRequest, exists chan *types.Scan, singleRet chan *types.Scan)

func (*Worker) JobsInSystem

func (w *Worker) JobsInSystem() int

func (*Worker) Start

func (w *Worker) Start()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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