repository

package
v0.0.0-...-fff90db Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAnalysisNoResults indicates that no analysis were found matching the given criteria.
	ErrAnalysisNoResults = errors.New("no analysis found for the given criteria")
	// ErrAnalysisUnexpected indicates that an error occurred while trying to perform an operation on AnalysisRepository.
	ErrAnalysisUnexpected = errors.New("unexpected error performing the current operation on AnalysisRepository")
)
View Source
var (
	// ErrIdentifierNoResults indicates that no identifiers were found matching the given criteria.
	ErrIdentifierNoResults = errors.New("no identifiers found for the given criteria")
	// ErrIdentifierUnexpected indicates that an error occurred while trying to perform an operation on IdentifierRepository.
	ErrIdentifierUnexpected = errors.New("unexpected error performing the current operation on IdentifierRepository")
)
View Source
var (
	// ErrInsightNoResults indicates that no insights were found matching the given criteria.
	ErrInsightNoResults = errors.New("no insights found for the given criteria")
	// ErrInsightUnexpected indicates that an error occurred while trying to perform an operation on InsightRespository.
	ErrInsightUnexpected = errors.New("unexpected error performing the current operation on Insightrepository")
)
View Source
var (
	// ErrProjectNoResults indicates that no projects were found matching the given criteria.
	ErrProjectNoResults = errors.New("no projects found for the given criteria")
	// ErrProjectUnexpected indicates that the current action couldn't be completed because of an internal issue.
	ErrProjectUnexpected = errors.New("unexpected error performing the current action")
)
View Source
var (
	// ErrSourceCodeUnableCreateDestination indicates that the underlying cloned source code destination couldn't be created.
	ErrSourceCodeUnableCreateDestination = errors.New("unable to create destination for source code")
	// ErrSourceCodeUnableCloneRemoteRepository indicates the remote repository couldn't be reached.
	ErrSourceCodeUnableCloneRemoteRepository = errors.New("unable to clone remote repository")
	// ErrSourceCodeUnableAccessMetadata indicates that the metadata for the current remote repository couldn't be reached.
	ErrSourceCodeUnableAccessMetadata = errors.New("unable to access source code metadata information")
	// ErrSourceCodeUnableToRemove indicates the source code couldn't be removed from the underlying storage.
	ErrSourceCodeUnableToRemove = errors.New("unable to remove source code")
	// ErrSourceCodeUnableReadFile indicates that the requested file couldn't be accessed or read from the underlying storage.
	ErrSourceCodeUnableReadFile = errors.New("unable to access or read file")
	// ErrSourceCodeNotFound indicates the source code is not present on the underlying storage.
	ErrSourceCodeNotFound = errors.New("unable to locate source code")
)
View Source
var (
	// ErrMetadataUnexpected indicates that the current action couldn't be completed because of an internal issue.
	ErrMetadataUnexpected = errors.New("unexpected error performing the current action")
)

Functions

This section is empty.

Types

type AnalysisRepository

type AnalysisRepository interface {
	// Add adds a new Analysis Results to the current repository.
	Add(ctx context.Context, analysis entity.AnalysisResults) error
	// GetByProjectID retrieves an existing analysis for the given Project.
	GetByProjectID(ctx context.Context, projectID uuid.UUID) (entity.AnalysisResults, error)
	// Delete removes an Analysis from the current repository, using its ID.
	Delete(ctx context.Context, id uuid.UUID) error
}

AnalysisRepository represents a repository able to store and retrieve analysis results.

type IdentifierRepository

type IdentifierRepository interface {
	// Add associates an identifier with a given Analysis.
	Add(ctx context.Context, analysis entity.AnalysisResults, ident entity.Identifier) error
	// FindAllByAnalysisID retrives a list of identifiers associated to the given analysis.
	FindAllByAnalysisID(ctx context.Context, analysisID uuid.UUID) ([]entity.Identifier, error)
	// FindAllByProjectAndFile retrieve a list of identifiers that match the given criteria.
	FindAllByProjectAndFile(ctx context.Context, projectRef string, filename string) ([]entity.Identifier, error)
	// DeleteAllByAnalysisID removes every identifiers related to a given Analysis ID.
	DeleteAllByAnalysisID(ctx context.Context, analysisID uuid.UUID) error
}

IdentifierRepository represents a repository able to store and retrieve identifiers.

type InsightRepository

type InsightRepository interface {
	// AddAll adds the provided insights to the repository.
	AddAll(ctx context.Context, insights []entity.Insight) error
	// GetByAnalysisID retrieves a list of Insight for a given analysis ID.
	GetByAnalysisID(ctx context.Context, analysisID uuid.UUID) ([]entity.Insight, error)
	// DeleteAllByAnalysisID removes all the Insights related to an analysis ID.
	DeleteAllByAnalysisID(ctx context.Context, analysisID uuid.UUID) error
}

InsightRepository represents a repository able to store, retrieve and delete insights.

type MetadataRepository

type MetadataRepository interface {
	// RetrieveMetada extracts context information from a remote repository.
	RetrieveMetadata(ctx context.Context, remoteRepository string) (entity.Metadata, error)
}

MetadataRepository represents a repository capable of retrieving metadata from a remote project.

type ProjectRepository

type ProjectRepository interface {
	// Add adds a new Project to the current repository.
	Add(ctx context.Context, project entity.Project) error
	// Get retrieves a Project by ID.
	Get(ctx context.Context, ID uuid.UUID) (entity.Project, error)
	// GetByReference retrieves a Project using its reference name.
	GetByReference(ctx context.Context, projectRef string) (entity.Project, error)
	// Delete removes an existing Project from the current repository.
	Delete(ctx context.Context, ID uuid.UUID) error
}

ProjectRepository represents a repository capable of operating with new and existing projects.

type SourceCodeRepository

type SourceCodeRepository interface {
	// Clone clones the source code, under a given name, using the provided clone URL.
	Clone(ctx context.Context, fullname string, cloneURL string) (entity.SourceCode, error)
	// Remove removes the source code on the given location.
	Remove(ctx context.Context, location string) error
	// Read reads the content of the given file, relative to the provided location.
	Read(ctx context.Context, location string, filename string) ([]byte, error)
}

SourceCodeRepository represents a repository capable of handle source code.

Jump to

Keyboard shortcuts

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