api

package
v0.3.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 44 Imported by: 29

Documentation

Index

Constants

View Source
const (
	AddonsRoot = "/addons"
	AddonRoot  = AddonsRoot + "/:" + Name
)

Routes

View Source
const (
	EffortS  = "small"
	EffortM  = "medium"
	EffortL  = "large"
	EffortXL = "extra_large"
)

Effort estimates

View Source
const (
	AnalysesRoot          = "/analyses"
	AnalysisRoot          = AnalysesRoot + "/:" + ID
	AnalysesDepsRoot      = AnalysesRoot + "/dependencies"
	AnalysesIssuesRoot    = AnalysesRoot + "/issues"
	AnalysesIssueRoot     = AnalysesIssuesRoot + "/:" + ID
	AnalysisIncidentsRoot = AnalysesIssueRoot + "/incidents"
	//
	AnalysesReportRoot           = AnalysesRoot + "/report"
	AnalysisReportDepsRoot       = AnalysesReportRoot + "/dependencies"
	AnalysisReportRuleRoot       = AnalysesReportRoot + "/rules"
	AnalysisReportIssuesRoot     = AnalysesReportRoot + "/issues"
	AnalysisReportAppsRoot       = AnalysesReportRoot + "/applications"
	AnalysisReportIssueRoot      = AnalysisReportIssuesRoot + "/:" + ID
	AnalysisReportIssuesAppsRoot = AnalysisReportIssuesRoot + "/applications"
	AnalysisReportDepsAppsRoot   = AnalysisReportDepsRoot + "/applications"
	AnalysisReportAppsIssuesRoot = AnalysisReportAppsRoot + "/:" + ID + "/issues"
	AnalysisReportFileRoot       = AnalysisReportIssueRoot + "/files"
	//
	AppAnalysesRoot       = ApplicationRoot + "/analyses"
	AppAnalysisRoot       = ApplicationRoot + "/analysis"
	AppAnalysisReportRoot = AppAnalysisRoot + "/report"
	AppAnalysisDepsRoot   = AppAnalysisRoot + "/dependencies"
	AppAnalysisIssuesRoot = AppAnalysisRoot + "/issues"
)

Routes

View Source
const (
	IssueField = "issues"
	DepField   = "dependencies"
)
View Source
const (
	ApplicationsRoot     = "/applications"
	ApplicationRoot      = ApplicationsRoot + "/:" + ID
	ApplicationTagsRoot  = ApplicationRoot + "/tags"
	ApplicationTagRoot   = ApplicationTagsRoot + "/:" + ID2
	ApplicationFactsRoot = ApplicationRoot + "/facts"
	ApplicationFactRoot  = ApplicationFactsRoot + "/:" + Key
	AppBucketRoot        = ApplicationRoot + "/bucket"
	AppBucketContentRoot = AppBucketRoot + "/*" + Wildcard
	AppStakeholdersRoot  = ApplicationRoot + "/stakeholders"
	AppAssessmentsRoot   = ApplicationRoot + "/assessments"
	AppAssessmentRoot    = AppAssessmentsRoot + "/:" + ID2
)

Routes

View Source
const (
	SourceAssessment = "assessment"
	SourceArchetype  = "archetype"
)

Tag Sources

View Source
const (
	ArchetypesRoot           = "/archetypes"
	ArchetypeRoot            = ArchetypesRoot + "/:" + ID
	ArchetypeAssessmentsRoot = ArchetypeRoot + "/assessments"
)

Routes

View Source
const (
	AssessmentsRoot = "/assessments"
	AssessmentRoot  = AssessmentsRoot + "/:" + ID
)

Routes

View Source
const (
	AuthRoot        = "/auth"
	AuthLoginRoot   = AuthRoot + "/login"
	AuthRefreshRoot = AuthRoot + "/refresh"
)

Routes

View Source
const (
	MaxPage  = 500
	MaxCount = 50000
)
View Source
const (
	BatchRoot        = "/batch"
	BatchTicketsRoot = BatchRoot + TicketsRoot
	BatchTagsRoot    = BatchRoot + TagsRoot
)

Routes

View Source
const (
	BucketsRoot       = "/buckets"
	BucketRoot        = BucketsRoot + "/:" + ID
	BucketContentRoot = BucketRoot + "/*" + Wildcard
)

Routes

View Source
const (
	BusinessServicesRoot = "/businessservices"
	BusinessServiceRoot  = BusinessServicesRoot + "/:" + ID
)

Routes

View Source
const (
	CacheRoot    = "/cache"
	CacheDirRoot = CacheRoot + "/*" + Wildcard
)

Routes

View Source
const (
	DependenciesRoot = "/dependencies"
	DependencyRoot   = DependenciesRoot + "/:" + ID
)

Routes

View Source
const (
	FilesRoot = "/files"
	FileRoot  = FilesRoot + "/:" + ID
)

Routes

View Source
const (
	StakeholderGroupsRoot = "/stakeholdergroups"
	StakeholderGroupRoot  = StakeholderGroupsRoot + "/:" + ID
)

Routes

View Source
const (
	IdentitiesRoot = "/identities"
	IdentityRoot   = IdentitiesRoot + "/:" + ID
)

Routes

View Source
const (
	Decrypted = "decrypted"
	AppId     = "application"
)

Params.

View Source
const (
	RecordTypeApplication = "1"
	RecordTypeDependency  = "2"
)

Record types

View Source
const (
	InProgress = "In Progress"
	Completed  = "Completed"
)

Import Statuses

View Source
const (
	SummariesRoot = "/importsummaries"
	SummaryRoot   = SummariesRoot + "/:" + ID
	UploadRoot    = SummariesRoot + "/upload"
	DownloadRoot  = SummariesRoot + "/download"
	ImportsRoot   = "/imports"
	ImportRoot    = ImportsRoot + "/:" + ID
)

Routes

View Source
const (
	JobFunctionsRoot = "/jobfunctions"
	JobFunctionRoot  = JobFunctionsRoot + "/:" + ID
)

Routes

View Source
const (
	MigrationWavesRoot = "/migrationwaves"
	MigrationWaveRoot  = MigrationWavesRoot + "/:" + ID
)

Routes

View Source
const (
	ID        = "id"
	ID2       = "id2"
	Key       = "key"
	Name      = "name"
	Filter    = filter.QueryParam
	Wildcard  = "wildcard"
	FileField = "file"
)

Params

View Source
const (
	Accept        = "Accept"
	Authorization = "Authorization"
	ContentLength = "Content-Length"
	ContentType   = "Content-Type"
	Directory     = "X-Directory"
	Total         = "X-Total"
)

Headers

View Source
const (
	MIMEOCTETSTREAM = "application/octet-stream"
	TAR             = "application/x-tar"
)

MIME Types.

View Source
const (
	DirectoryArchive = "archive"
	DirectoryExpand  = "expand"
)

Header Values

View Source
const (
	ProxiesRoot = "/proxies"
	ProxyRoot   = ProxiesRoot + "/:" + ID
)

Routes

View Source
const (
	QuestionnairesRoot = "/questionnaires"
	QuestionnaireRoot  = QuestionnairesRoot + "/:" + ID
)

Routes

View Source
const (
	ReviewsRoot = "/reviews"
	ReviewRoot  = ReviewsRoot + "/:" + ID
	CopyRoot    = ReviewsRoot + "/copy"
)

Routes

View Source
const (
	RuleSetsRoot = "/rulesets"
	RuleSetRoot  = RuleSetsRoot + "/:" + ID
)

Routes

View Source
const (
	SettingsRoot = "/settings"
	SettingRoot  = SettingsRoot + "/:" + Key
)

Routes

View Source
const (
	StakeholdersRoot = "/stakeholders"
	StakeholderRoot  = StakeholdersRoot + "/:" + ID
)

Routes

View Source
const (
	TagsRoot = "/tags"
	TagRoot  = TagsRoot + "/:" + ID
)

Routes

View Source
const (
	TagCategoriesRoot   = "/tagcategories"
	TagCategoryRoot     = TagCategoriesRoot + "/:" + ID
	TagCategoryTagsRoot = TagCategoryRoot + "/tags"
)

Routes

View Source
const (
	TargetsRoot = "/targets"
	TargetRoot  = TargetsRoot + "/:" + ID
)

Routes

View Source
const (
	TasksRoot             = "/tasks"
	TaskRoot              = TasksRoot + "/:" + ID
	TaskReportRoot        = TaskRoot + "/report"
	TaskBucketRoot        = TaskRoot + "/bucket"
	TaskBucketContentRoot = TaskBucketRoot + "/*" + Wildcard
	TaskSubmitRoot        = TaskRoot + "/submit"
	TaskCancelRoot        = TaskRoot + "/cancel"
)

Routes

View Source
const (
	TaskGroupsRoot             = "/taskgroups"
	TaskGroupRoot              = TaskGroupsRoot + "/:" + ID
	TaskGroupBucketRoot        = TaskGroupRoot + "/bucket"
	TaskGroupBucketContentRoot = TaskGroupBucketRoot + "/*" + Wildcard
	TaskGroupSubmitRoot        = TaskGroupRoot + "/submit"
)

Routes

View Source
const (
	TicketsRoot = "/tickets"
	TicketRoot  = "/tickets" + "/:" + ID
)

Routes

View Source
const (
	TrackersRoot             = "/trackers"
	TrackerRoot              = "/trackers" + "/:" + ID
	TrackerProjects          = TrackerRoot + "/projects"
	TrackerProject           = TrackerRoot + "/projects" + "/:" + ID2
	TrackerProjectIssueTypes = TrackerProject + "/issuetypes"
)

Routes

View Source
const (
	AdoptionPlansRoot = "/reports/adoptionplan"
)

Routes

View Source
const (
	Connected = "connected"
)

Params

View Source
const (
	Kind = "kind"
)
View Source
const (
	LocatorParam = "locator"
)
View Source
const (
	Source = "source"
)

Params

View Source
const (
	TrackerId = "tracker"
)

Params.

Variables

BindMIMEs supported binding MIME types.

View Source
var Log = logr.WithName("api")
View Source
var (
	Settings = &settings.Settings
)

Functions

func ErrorHandler added in v0.1.0

func ErrorHandler() gin.HandlerFunc

ErrorHandler handles error conditions from lower handlers.

func MetricsHandler added in v0.2.0

func MetricsHandler() http.Handler

MetricsHandler godoc @summary Get Prometheus metrics. @description Get Prometheus metrics. @description Wrapper for Prometheus-supplied handler. @description Served on port defined by METRICS_PORT environment variable. @tags metrics @produce text/plain @success 200 @router /metrics [get]

func Render added in v0.2.0

func Render() gin.HandlerFunc

Render renders the response based on the Accept: header. Opinionated towards json.

func Required added in v0.1.0

func Required(scope string) func(*gin.Context)

Required enforces that the user (identified by a token) has been granted the necessary scope to access a resource.

func Transaction added in v0.1.0

func Transaction(ctx *gin.Context)

Transaction handler.

Types

type Addon

type Addon struct {
	Name  string `json:"name"`
	Image string `json:"image"`
}

Addon REST resource.

func (*Addon) With

func (r *Addon) With(m *crd.Addon)

With model.

type AddonHandler

type AddonHandler struct {
	BaseHandler
}

AddonHandler handles addon routes.

func (AddonHandler) AddRoutes

func (h AddonHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (AddonHandler) Get

func (h AddonHandler) Get(ctx *gin.Context)

Get godoc @summary Get an addon by name. @description Get an addon by name. @tags addons @produce json @success 200 {object} api.Addon @router /addons/{name} [get] @param name path string true "Addon name"

func (AddonHandler) List

func (h AddonHandler) List(ctx *gin.Context)

List godoc @summary List all addons. @description List all addons. @tags addons @produce json @success 200 {object} []api.Addon @router /addons [get]

type AdoptionPlanHandler

type AdoptionPlanHandler struct {
	BaseHandler
}

func (AdoptionPlanHandler) AddRoutes

func (h AdoptionPlanHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (AdoptionPlanHandler) Graph

func (h AdoptionPlanHandler) Graph(ctx *gin.Context)

Graph godoc @summary Generate an application dependency graph arranged in topological order. @description Graph generates an application dependency graph arranged in topological order. @tags adoptionplans @produce json @success 200 {object} []api.Vertex @router /adoptionplans [post] @param requestedApps body []uint true "List of requested App IDs"

type Analysis added in v0.2.0

type Analysis struct {
	Resource     `yaml:",inline"`
	Effort       int              `json:"effort"`
	Archived     bool             `json:"archived,omitempty" yaml:",omitempty"`
	Issues       []Issue          `json:"issues,omitempty" yaml:",omitempty"`
	Dependencies []TechDependency `json:"dependencies,omitempty" yaml:",omitempty"`
	Summary      []ArchivedIssue  `json:"summary,omitempty" yaml:",omitempty" swaggertype:"object"`
}

Analysis REST resource.

func (*Analysis) Model added in v0.2.0

func (r *Analysis) Model() (m *model.Analysis)

Model builds a model.

func (*Analysis) With added in v0.2.0

func (r *Analysis) With(m *model.Analysis)

With updates the resource with the model.

type AnalysisHandler added in v0.2.0

type AnalysisHandler struct {
	BaseHandler
}

AnalysisHandler handles analysis resource routes.

func (AnalysisHandler) AddRoutes added in v0.2.0

func (h AnalysisHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (AnalysisHandler) AppCreate added in v0.2.0

func (h AnalysisHandler) AppCreate(ctx *gin.Context)

AppCreate godoc @summary Create an analysis. @description Create an analysis. @description Form fields: @description - file: file that contains the api.Analysis resource. @description - issues: file that multiple api.Issue resources. @description - dependencies: file that multiple api.TechDependency resources. @tags analyses @produce json @success 201 {object} api.Analysis @router /application/{id}/analyses [post] @param id path int true "Application ID"

func (AnalysisHandler) AppDeps added in v0.2.0

func (h AnalysisHandler) AppDeps(ctx *gin.Context)

AppDeps godoc @summary List application dependencies. @description List application dependencies. @description filters: @description - name @description - version @description - sha @description - indirect @description - labels @tags dependencies @produce json @success 200 {object} []api.TechDependency @router /application/{id}/analysis/dependencies [get] @param id path int true "Application ID"

func (AnalysisHandler) AppIssueReports added in v0.3.0

func (h AnalysisHandler) AppIssueReports(ctx *gin.Context)

AppIssueReports godoc @summary List application issue reports. @description Each report collates issues by ruleset/rule. @description filters: @description - ruleset @description - rule @description - category @description - effort @description - labels @description sort: @description - ruleset @description - rule @description - category @description - effort @description - files @tags issuereport @produce json @success 200 {object} []api.IssueReport @router /analyses/report/applications/{id}/issues [get] @param id path int true "Application ID"

func (AnalysisHandler) AppIssues added in v0.2.0

func (h AnalysisHandler) AppIssues(ctx *gin.Context)

AppIssues godoc @summary List application issues. @description List application issues. @description filters: @description - ruleset @description - rule @description - name @description - category @description - effort @description - labels @tags issues @produce json @success 200 {object} []api.Issue @router /application/{id}/analysis/issues [get] @param id path int true "Application ID"

func (AnalysisHandler) AppLatest added in v0.2.0

func (h AnalysisHandler) AppLatest(ctx *gin.Context)

AppLatest godoc @summary Get the latest analysis. @description Get the latest analysis for an application. @tags analyses @produce octet-stream @success 200 {object} api.Analysis @router /applications/{id}/analysis [get] @param id path int true "Application ID"

func (AnalysisHandler) AppLatestReport added in v0.3.0

func (h AnalysisHandler) AppLatestReport(ctx *gin.Context)

AppLatestReport godoc @summary Get the latest analysis (static) report. @description Get the latest analysis (static) report. @tags analyses @produce octet-stream @success 200 @router /applications/{id}/analysis/report [get] @param id path int true "Application ID"

func (AnalysisHandler) AppList added in v0.2.0

func (h AnalysisHandler) AppList(ctx *gin.Context)

AppList godoc @summary List analyses. @description List analyses for an application. @description Resources do not include relations. @tags analyses @produce json @success 200 {object} []api.Analysis @router /analyses [get]

func (AnalysisHandler) Delete added in v0.2.0

func (h AnalysisHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete an analysis by ID. @description Delete an analysis by ID. @tags analyses @success 204 @router /analyses/{id} [delete] @param id path int true "Analysis ID"

func (AnalysisHandler) DepAppReports added in v0.3.0

func (h AnalysisHandler) DepAppReports(ctx *gin.Context)

DepAppReports godoc @summary List application reports. @description List application reports. @description filters: @description - id @description - name @description - description @description - businessService @description - provider @description - name @description - version @description - sha @description - indirect @description - dep.provider @description - dep.name @description - dep.version @description - dep.sha @description - dep.indirect @description - dep.labels @description - application.id @description - application.name @description - businessService.id @description - businessService.name @description sort: @description - name @description - description @description - businessService @description - provider @description - name @description - version @description - sha @description - indirect @tags depappreports @produce json @success 200 {object} []api.DepAppReport @router /analyses/report/applications [get]

func (AnalysisHandler) DepReports added in v0.2.0

func (h AnalysisHandler) DepReports(ctx *gin.Context)

DepReports godoc @summary List dependency reports. @description Each report collates dependencies by name and SHA. @description filters: @description - provider @description - name @description - version @description - sha @description - indirect @description - labels @description - application.id @description - application.name @description - businessService.id @description - businessService.name @description - tag.id @description sort: @description - provider @description - name @description - version @description - sha @tags dependencies @produce json @success 200 {object} []api.TechDependency @router /analyses/dependencies [get]

func (AnalysisHandler) Deps added in v0.2.0

func (h AnalysisHandler) Deps(ctx *gin.Context)

Deps godoc @summary List dependencies. @description List dependencies. @description filters: @description - name @description - version @description - sha @description - indirect @description - labels @description - application.id @description - application.name @description - tag.id @tags dependencies @produce json @success 200 {object} []api.TechDependency @router /analyses/dependencies [get]

func (AnalysisHandler) FileReports added in v0.2.0

func (h AnalysisHandler) FileReports(ctx *gin.Context)

FileReports godoc @summary List incident file reports. @description Each report collates incidents by file. @description filters: @description - file @description - effort @description - incidents @description sort: @description - file @description - effort @description - incidents @tags filereports @produce json @success 200 {object} []api.FileReport @router /analyses/report/issues/{id}/files [get] @param id path int true "Issue ID"

func (AnalysisHandler) Get added in v0.2.0

func (h AnalysisHandler) Get(ctx *gin.Context)

Get godoc @summary Get an analysis (report) by ID. @description Get an analysis (report) by ID. @tags analyses @produce octet-stream @success 200 {object} api.Analysis @router /analyses/{id} [get] @param id path int true "Analysis ID"

func (AnalysisHandler) Incidents added in v0.2.0

func (h AnalysisHandler) Incidents(ctx *gin.Context)

Incidents godoc @summary List incidents for an issue. @description List incidents for an issue. @description filters: @description - file @tags incidents @produce json @success 200 {object} []api.Incident @router /analyses/issues/{id}/incidents [get] @param id path int true "Issue ID"

func (AnalysisHandler) Issue added in v0.2.0

func (h AnalysisHandler) Issue(ctx *gin.Context)

Issue godoc @summary Get an issue. @description Get an issue. @tags issue @produce json @success 200 {object} api.Issue @router /analyses/issues/{id} [get] @param id path int true "Issue ID"

func (AnalysisHandler) IssueAppReports added in v0.3.0

func (h AnalysisHandler) IssueAppReports(ctx *gin.Context)

IssueAppReports godoc @summary List application reports. @description List application reports. @description filters: @description - id @description - name @description - description @description - businessService @description - effort @description - incidents @description - files @description - issue.id @description - issue.name @description - issue.ruleset @description - issue.rule @description - issue.category @description - issue.effort @description - issue.labels @description - application.id @description - application.name @description - businessService.id @description - businessService.name @description sort: @description - id @description - name @description - description @description - businessService @description - effort @description - incidents @description - files @tags issueappreports @produce json @success 200 {object} []api.IssueAppReport @router /analyses/report/applications [get]

func (AnalysisHandler) Issues added in v0.2.0

func (h AnalysisHandler) Issues(ctx *gin.Context)

Issues godoc @summary List all issues. @description List all issues. @description filters: @description - ruleset @description - rule @description - name @description - category @description - effort @description - labels @description - application.id @description - application.name @description - tag.id @tags issues @produce json @success 200 {object} []api.Issue @router /analyses/issues [get]

func (AnalysisHandler) RuleReports added in v0.2.0

func (h AnalysisHandler) RuleReports(ctx *gin.Context)

RuleReports godoc @summary List rule reports. @description Each report collates issues by ruleset/rule. @description filters: @description - ruleset @description - rule @description - category @description - effort @description - labels @description - applications @description - application.id @description - application.name @description - businessService.id @description - businessService.name @description - tag.id @description sort: @description - ruleset @description - rule @description - category @description - effort @description - applications @tags rulereports @produce json @success 200 {object} []api.RuleReport @router /analyses/report/rules [get]

type AnalysisWriter added in v0.3.0

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

AnalysisWriter used to create a file containing an analysis.

func (*AnalysisWriter) Create added in v0.3.0

func (r *AnalysisWriter) Create(id uint) (path string, err error)

Create an analysis file and returns the path.

func (*AnalysisWriter) Write added in v0.3.0

func (r *AnalysisWriter) Write(id uint, output io.Writer) (err error)

Write the analysis file.

type Application

type Application struct {
	Resource        `yaml:",inline"`
	Name            string      `json:"name" binding:"required"`
	Description     string      `json:"description"`
	Bucket          *Ref        `json:"bucket"`
	Repository      *Repository `json:"repository"`
	Binary          string      `json:"binary"`
	Review          *Ref        `json:"review"`
	Comments        string      `json:"comments"`
	Identities      []Ref       `json:"identities"`
	Tags            []TagRef    `json:"tags"`
	BusinessService *Ref        `json:"businessService" yaml:"businessService"`
	Owner           *Ref        `json:"owner"`
	Contributors    []Ref       `json:"contributors"`
	MigrationWave   *Ref        `json:"migrationWave" yaml:"migrationWave"`
	Archetypes      []Ref       `json:"archetypes"`
	Assessments     []Ref       `json:"assessments"`
	Assessed        bool        `json:"assessed"`
	Risk            string      `json:"risk"`
	Confidence      int         `json:"confidence"`
	Effort          int         `json:"effort"`
}

Application REST resource.

func (*Application) Model

func (r *Application) Model() (m *model.Application)

Model builds a model.

func (*Application) With

func (r *Application) With(m *model.Application, tags []model.ApplicationTag)

With updates the resource using the model.

func (*Application) WithResolver added in v0.3.0

func (r *Application) WithResolver(resolver *assessment.ApplicationResolver) (err error)

WithResolver uses an ApplicationResolver to update the resource with values derived from the application's assessments and archetypes.

func (*Application) WithVirtualTags added in v0.3.0

func (r *Application) WithVirtualTags(tags []model.Tag, source string)

WithVirtualTags updates the resource with tags derived from assessments.

type ApplicationHandler

type ApplicationHandler struct {
	BucketOwner
}

ApplicationHandler handles application resource routes.

func (ApplicationHandler) AddRoutes

func (h ApplicationHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (ApplicationHandler) AssessmentCreate added in v0.3.0

func (h ApplicationHandler) AssessmentCreate(ctx *gin.Context)

AssessmentCreate godoc @summary Create an application assessment. @description Create an application assessment. @tags applications @accept json @produce json @success 201 {object} api.Assessment @router /applications/{id}/assessments [post] @param id path int true "Application ID" @param assessment body api.Assessment true "Assessment data"

func (ApplicationHandler) AssessmentList added in v0.3.0

func (h ApplicationHandler) AssessmentList(ctx *gin.Context)

AssessmentList godoc @summary List the assessments of an Application and any it inherits from its archetypes. @description List the assessments of an Application and any it inherits from its archetypes. @tags applications @success 200 {object} []api.Assessment @router /applications/{id}/assessments [get] @param id path int true "Application ID"

func (ApplicationHandler) BucketDelete

func (h ApplicationHandler) BucketDelete(ctx *gin.Context)

BucketDelete godoc @summary Delete bucket content by ID and path. @description Delete bucket content by ID and path. @tags applications @produce json @success 204 @router /applications/{id}/bucket/{wildcard} [delete] @param id path int true "Application ID" @param wildcard path string true "Content path"

func (ApplicationHandler) BucketGet

func (h ApplicationHandler) BucketGet(ctx *gin.Context)

BucketGet godoc @summary Get bucket content by ID and path. @description Get bucket content by ID and path. @description Returns index.html for directories when Accept=text/html else a tarball. @description ?filter=glob supports directory content filtering. @tags applications @produce octet-stream @success 200 @router /applications/{id}/bucket/{wildcard} [get] @param id path int true "Application ID" @param wildcard path string true "Content path" @param filter query string false "Filter"

func (ApplicationHandler) BucketPut added in v0.1.0

func (h ApplicationHandler) BucketPut(ctx *gin.Context)

BucketPut godoc @summary Upload bucket content by ID and path. @description Upload bucket content by ID and path (handles both [post] and [put] requests). @tags applications @produce json @success 204 @router /applications/{id}/bucket/{wildcard} [post] @param id path int true "Application ID" @param wildcard path string true "Content path"

func (ApplicationHandler) Create

func (h ApplicationHandler) Create(ctx *gin.Context)

Create godoc @summary Create an application. @description Create an application. @tags applications @accept json @produce json @success 201 {object} api.Application @router /applications [post] @param application body api.Application true "Application data"

func (ApplicationHandler) Delete

func (h ApplicationHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete an application. @description Delete an application. @tags applications @success 204 @router /applications/{id} [delete] @param id path int true "Application id"

func (ApplicationHandler) DeleteList

func (h ApplicationHandler) DeleteList(ctx *gin.Context)

DeleteList godoc @summary Delete a applications. @description Delete applications. @tags applications @success 204 @router /applications [delete] @param application body []uint true "List of id"

func (ApplicationHandler) FactCreate added in v0.1.0

func (h ApplicationHandler) FactCreate(ctx *gin.Context)

FactCreate godoc @summary Create a fact. @description Create a fact. @tags applications @accept json @produce json @success 201 @router /applications/{id}/facts [post] @param id path int true "Application ID" @param fact body api.Fact true "Fact data"

func (ApplicationHandler) FactDelete added in v0.1.0

func (h ApplicationHandler) FactDelete(ctx *gin.Context)

FactDelete godoc @summary Delete a fact. @description Delete a fact. @description see api.FactKey for details on key parameter format. @tags applications @success 204 @router /applications/{id}/facts/{key} [delete] @param id path int true "Application ID" @param key path string true "Fact key"

func (ApplicationHandler) FactGet added in v0.1.0

func (h ApplicationHandler) FactGet(ctx *gin.Context)

FactGet godoc @summary Get fact by name. @description Get fact by name. @description see api.FactKey for details on key parameter format. @tags applications @produce json @success 200 {object} object @router /applications/{id}/facts/{key} [get] @param id path int true "Application ID" @param key path string true "Fact key"

func (ApplicationHandler) FactList added in v0.1.0

func (h ApplicationHandler) FactList(ctx *gin.Context, key FactKey)

FactList godoc @summary List facts. @description List facts by source. @description see api.FactKey for details on key parameter format. @tags applications @produce json @success 200 {object} api.FactMap @router /applications/{id}/facts/{source}: [get] @param id path int true "Application ID" @param source path string true "Source key"

func (ApplicationHandler) FactPut added in v0.1.0

func (h ApplicationHandler) FactPut(ctx *gin.Context)

FactPut godoc @summary Update (or create) a fact. @description Update (or create) a fact. @description see api.FactKey for details on key parameter format. @tags applications @accept json @produce json @success 204 @router /applications/{id}/facts/{key} [put] @param id path int true "Application ID" @param key path string true "Fact key" @param fact body object true "Fact value"

func (ApplicationHandler) FactReplace added in v0.2.0

func (h ApplicationHandler) FactReplace(ctx *gin.Context, key FactKey)

FactReplace godoc @summary Replace all facts from a source. @description Replace all facts from a source. @description see api.FactKey for details on key parameter format. @tags applications @success 204 @router /applications/{id}/facts/{source}: [put] @param id path int true "Application ID" @param source path string true "Fact key" @param factmap body api.FactMap true "Fact map"

func (ApplicationHandler) Get

func (h ApplicationHandler) Get(ctx *gin.Context)

Get godoc @summary Get an application by ID. @description Get an application by ID. @tags applications @produce json @success 200 {object} api.Application @router /applications/{id} [get] @param id path int true "Application ID"

func (ApplicationHandler) List

func (h ApplicationHandler) List(ctx *gin.Context)

List godoc @summary List all applications. @description List all applications. @tags applications @produce json @success 200 {object} []api.Application @router /applications [get]

func (ApplicationHandler) StakeholdersUpdate added in v0.1.0

func (h ApplicationHandler) StakeholdersUpdate(ctx *gin.Context)

StakeholdersUpdate godoc @summary Update the owner and contributors of an Application. @description Update the owner and contributors of an Application. @tags applications @success 204 @router /applications/{id}/stakeholders [patch] @param id path int true "Application ID" @param application body api.Stakeholders true "Application stakeholders"

func (ApplicationHandler) TagAdd

func (h ApplicationHandler) TagAdd(ctx *gin.Context)

TagAdd godoc @summary Add tag association. @description Ensure tag is associated with the application. @tags applications @accept json @produce json @success 201 {object} api.Ref @router /applications/{id}/tags [post] @param tag body Ref true "Tag data" @param id path int true "Application ID"

func (ApplicationHandler) TagDelete

func (h ApplicationHandler) TagDelete(ctx *gin.Context)

TagDelete godoc @summary Delete tag association. @description Ensure tag is not associated with the application. @tags applications @success 204 @router /applications/{id}/tags/{sid} [delete] @param id path int true "Application ID" @param sid path string true "Tag ID"

func (ApplicationHandler) TagList

func (h ApplicationHandler) TagList(ctx *gin.Context)

TagList godoc @summary List tag references. @description List tag references. @tags applications @produce json @success 200 {object} []api.Ref @router /applications/{id}/tags [get] @param id path int true "Application ID"

func (ApplicationHandler) TagReplace added in v0.1.0

func (h ApplicationHandler) TagReplace(ctx *gin.Context)

TagReplace godoc @summary Replace tag associations. @description Replace tag associations. @tags applications @accept json @success 204 @router /applications/{id}/tags [patch] @param id path int true "Application ID" @param source query string false "Source" @param tags body []TagRef true "Tag references"

func (ApplicationHandler) Update

func (h ApplicationHandler) Update(ctx *gin.Context)

Update godoc @summary Update an application. @description Update an application. @tags applications @accept json @success 204 @router /applications/{id} [put] @param id path int true "Application id" @param application body api.Application true "Application data"

type Archetype added in v0.3.0

type Archetype struct {
	Resource          `yaml:",inline"`
	Name              string   `json:"name" yaml:"name"`
	Description       string   `json:"description" yaml:"description"`
	Comments          string   `json:"comments" yaml:"comments"`
	Tags              []TagRef `json:"tags" yaml:"tags"`
	Criteria          []TagRef `json:"criteria" yaml:"criteria"`
	Stakeholders      []Ref    `json:"stakeholders" yaml:"stakeholders"`
	StakeholderGroups []Ref    `json:"stakeholderGroups" yaml:"stakeholderGroups"`
	Applications      []Ref    `json:"applications" yaml:"applications"`
	Assessments       []Ref    `json:"assessments" yaml:"assessments"`
	Assessed          bool     `json:"assessed"`
	Risk              string   `json:"risk"`
	Confidence        int      `json:"confidence"`
	Review            *Ref     `json:"review"`
}

Archetype REST resource.

func (*Archetype) Model added in v0.3.0

func (r *Archetype) Model() (m *model.Archetype)

Model builds a model from the resource.

func (*Archetype) With added in v0.3.0

func (r *Archetype) With(m *model.Archetype)

With updates the resource with the model.

func (*Archetype) WithResolver added in v0.3.0

func (r *Archetype) WithResolver(resolver *assessment.ArchetypeResolver) (err error)

WithResolver uses an ArchetypeResolver to update the resource with values derived from the archetype's assessments.

type ArchetypeHandler added in v0.3.0

type ArchetypeHandler struct {
	BaseHandler
}

ArchetypeHandler handles Archetype resource routes.

func (ArchetypeHandler) AddRoutes added in v0.3.0

func (h ArchetypeHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (ArchetypeHandler) AssessmentCreate added in v0.3.0

func (h ArchetypeHandler) AssessmentCreate(ctx *gin.Context)

AssessmentCreate godoc @summary Create an archetype assessment. @description Create an archetype assessment. @tags archetypes @accept json @produce json @success 201 {object} api.Assessment @router /archetypes/{id}/assessments [post] @param assessment body api.Assessment true "Assessment data" @param id path int true "Archetype ID"

func (ArchetypeHandler) AssessmentList added in v0.3.0

func (h ArchetypeHandler) AssessmentList(ctx *gin.Context)

AssessmentList godoc @summary List the assessments of an archetype. @description List the assessments of an archetype. @tags archetypes @success 200 {object} []api.Assessment @router /archetypes/{id}/assessments [get] @param id path int true "Archetype ID"

func (ArchetypeHandler) Create added in v0.3.0

func (h ArchetypeHandler) Create(ctx *gin.Context)

Create godoc @summary Create an archetype. @description Create an archetype. @tags archetypes @accept json @produce json @success 200 {object} api.Archetype @router /archetypes [post] @param archetype body api.Archetype true "Archetype data"

func (ArchetypeHandler) Delete added in v0.3.0

func (h ArchetypeHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete an archetype. @description Delete an archetype. @tags archetypes @success 204 @router /archetypes/{id} [delete] @param id path int true "Archetype ID"

func (ArchetypeHandler) Get added in v0.3.0

func (h ArchetypeHandler) Get(ctx *gin.Context)

Get godoc @summary Get an archetype by ID. @description Get an archetype by ID. @tags archetypes @produce json @success 200 {object} api.Archetype @router /archetypes/{id} [get] @param id path int true "Archetype ID"

func (ArchetypeHandler) List added in v0.3.0

func (h ArchetypeHandler) List(ctx *gin.Context)

List godoc @summary List all archetypes. @description List all archetypes. @tags archetypes @produce json @success 200 {object} []api.Archetype @router /archetypes [get]

func (ArchetypeHandler) Update added in v0.3.0

func (h ArchetypeHandler) Update(ctx *gin.Context)

Update godoc @summary Update an archetype. @description Update an archetype. @tags archetypes @accept json @success 204 @router /archetypes/{id} [put] @param id path int true "Archetype ID" @param archetype body api.Archetype true "Archetype data"

type ArchivedIssue added in v0.3.0

type ArchivedIssue model.ArchivedIssue

ArchivedIssue created when issues are archived.

type Assessment added in v0.3.0

type Assessment struct {
	Resource          `yaml:",inline"`
	Application       *Ref                 `json:"application,omitempty" yaml:",omitempty" binding:"excluded_with=Archetype"`
	Archetype         *Ref                 `json:"archetype,omitempty" yaml:",omitempty" binding:"excluded_with=Application"`
	Questionnaire     Ref                  `json:"questionnaire" binding:"required"`
	Sections          []assessment.Section `json:"sections"`
	Stakeholders      []Ref                `json:"stakeholders"`
	StakeholderGroups []Ref                `json:"stakeholderGroups" yaml:"stakeholderGroups"`
	// read only
	Risk         string                  `json:"risk"`
	Confidence   int                     `json:"confidence"`
	Status       string                  `json:"status"`
	Thresholds   assessment.Thresholds   `json:"thresholds"`
	RiskMessages assessment.RiskMessages `json:"riskMessages" yaml:"riskMessages"`
}

Assessment REST resource.

func (*Assessment) Model added in v0.3.0

func (r *Assessment) Model() (m *model.Assessment)

Model builds a model.

func (*Assessment) With added in v0.3.0

func (r *Assessment) With(m *model.Assessment)

With updates the resource with the model.

type AssessmentHandler added in v0.3.0

type AssessmentHandler struct {
	BaseHandler
}

AssessmentHandler handles Assessment resource routes.

func (AssessmentHandler) AddRoutes added in v0.3.0

func (h AssessmentHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (AssessmentHandler) Delete added in v0.3.0

func (h AssessmentHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete an assessment. @description Delete an assessment. @tags assessments @success 204 @router /assessments/{id} [delete] @param id path int true "Assessment ID"

func (AssessmentHandler) Get added in v0.3.0

func (h AssessmentHandler) Get(ctx *gin.Context)

Get godoc @summary Get an assessment by ID. @description Get an assessment by ID. @tags questionnaires @produce json @success 200 {object} api.Assessment @router /assessments/{id} [get] @param id path int true "Assessment ID"

func (AssessmentHandler) List added in v0.3.0

func (h AssessmentHandler) List(ctx *gin.Context)

List godoc @summary List all assessments. @description List all assessments. @tags assessments @produce json @success 200 {object} []api.Assessment @router /assessments [get]

func (AssessmentHandler) Update added in v0.3.0

func (h AssessmentHandler) Update(ctx *gin.Context)

Update godoc @summary Update an assessment. @description Update an assessment. @tags assessments @accept json @success 204 @router /assessments/{id} [put] @param id path int true "Assessment ID" @param assessment body api.Assessment true "Assessment data"

type AuthHandler

type AuthHandler struct {
	BaseHandler
}

AuthHandler handles auth routes.

func (AuthHandler) AddRoutes

func (h AuthHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (AuthHandler) Login

func (h AuthHandler) Login(ctx *gin.Context)

Login godoc @summary Login and obtain a bearer token. @description Login and obtain a bearer token. @tags auth @produce json @success 201 {object} api.Login @router /auth/login [post]

func (AuthHandler) Refresh added in v0.2.0

func (h AuthHandler) Refresh(ctx *gin.Context)

Refresh godoc @summary Refresh bearer token. @description Refresh bearer token. @tags auth @produce json @success 201 {object} api.Login @router /auth/refresh [post]

type BadRequestError added in v0.2.0

type BadRequestError struct {
	Reason string
}

BadRequestError reports bad request errors.

func (*BadRequestError) Error added in v0.2.0

func (r *BadRequestError) Error() string

func (*BadRequestError) Is added in v0.2.0

func (r *BadRequestError) Is(err error) (matched bool)

type BaseHandler

type BaseHandler struct{}

BaseHandler base handler.

func (*BaseHandler) Accepted added in v0.2.0

func (h *BaseHandler) Accepted(ctx *gin.Context, mimes ...string) (b bool)

Accepted determines if the mime is accepted. Wildcards ignored.

func (*BaseHandler) Attachment added in v0.3.0

func (h *BaseHandler) Attachment(ctx *gin.Context, name string)

Attachment sets the Content-Disposition header.

func (*BaseHandler) Bind added in v0.2.0

func (h *BaseHandler) Bind(ctx *gin.Context, r interface{}) (err error)

Bind based on Content-Type header. Opinionated towards json.

func (*BaseHandler) BindJSON added in v0.3.0

func (h *BaseHandler) BindJSON(ctx *gin.Context, r interface{}) (err error)

BindJSON attempts to bind a request body to a struct, assuming that the body is JSON. Binding is strict: unknown fields in the input will cause binding to fail.

func (*BaseHandler) BindYAML added in v0.3.0

func (h *BaseHandler) BindYAML(ctx *gin.Context, r interface{}) (err error)

BindYAML attempts to bind a request body to a struct, assuming that the body is YAML. Binding is strict: unknown fields in the input will cause binding to fail.

func (*BaseHandler) Client

func (h *BaseHandler) Client(ctx *gin.Context) (client client.Client)

Client returns k8s client from the context.

func (*BaseHandler) CurrentUser

func (h *BaseHandler) CurrentUser(ctx *gin.Context) (user string)

CurrentUser gets username from Keycloak auth token.

func (*BaseHandler) DB

func (h *BaseHandler) DB(ctx *gin.Context) (db *gorm.DB)

DB return db client associated with the context.

func (*BaseHandler) Decoder added in v0.2.0

func (h *BaseHandler) Decoder(ctx *gin.Context, encoding string, r io.Reader) (d Decoder, err error)

Decoder returns a decoder based on encoding. Opinionated towards json.

func (*BaseHandler) HasScope

func (h *BaseHandler) HasScope(ctx *gin.Context, scope string) (b bool)

HasScope determines if the token has the specified scope.

func (*BaseHandler) Respond added in v0.2.0

func (h *BaseHandler) Respond(ctx *gin.Context, code int, r interface{})

Respond sets the response.

func (*BaseHandler) Status added in v0.2.0

func (h *BaseHandler) Status(ctx *gin.Context, code int)

Status sets the status code.

func (*BaseHandler) Validate added in v0.3.0

func (h *BaseHandler) Validate(r interface{}) (err error)

Validate that the struct field values obey the binding field tags.

func (*BaseHandler) WithCount added in v0.2.0

func (h *BaseHandler) WithCount(ctx *gin.Context, count int64) (err error)

WithCount report count. Sets the X-Total header for pagination. Returns an error when count exceeds the limited and is not constrained by pagination.

type BatchError added in v0.2.0

type BatchError struct {
	Message string
	Items   []BatchErrorItem
}

BatchError reports errors stemming from batch operations.

func (BatchError) Error added in v0.2.0

func (r BatchError) Error() string

func (BatchError) Is added in v0.2.0

func (r BatchError) Is(err error) (matched bool)

type BatchErrorItem added in v0.2.0

type BatchErrorItem struct {
	Error    error
	Resource interface{}
}

type BatchHandler added in v0.2.0

type BatchHandler struct {
	BaseHandler
}

BatchHandler handles batch resource creation routes.

func (BatchHandler) AddRoutes added in v0.2.0

func (h BatchHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (BatchHandler) TagsCreate added in v0.2.0

func (h BatchHandler) TagsCreate(ctx *gin.Context)

TagsCreate godoc @summary Batch-create Tags. @description Batch-create Tags. @tags batch, tags @produce json @success 200 {object} []api.Tag @router /batch/tags [post] @param tags body []api.Tag true "Tags data"

func (BatchHandler) TicketsCreate added in v0.2.0

func (h BatchHandler) TicketsCreate(ctx *gin.Context)

TicketsCreate godoc @summary Batch-create Tickets. @description Batch-create Tickets. @tags batch, tickets @produce json @success 200 {object} []api.Ticket @router /batch/tickets [post] @param tickets body []api.Ticket true "Tickets data"

type Bucket added in v0.1.0

type Bucket struct {
	Resource   `yaml:",inline"`
	Path       string     `json:"path"`
	Expiration *time.Time `json:"expiration,omitempty"`
}

Bucket REST resource.

func (*Bucket) With added in v0.1.0

func (r *Bucket) With(m *model.Bucket)

With updates the resource with the model.

type BucketHandler

type BucketHandler struct {
	BucketOwner
}

BucketHandler handles bucket routes.

func (BucketHandler) AddRoutes added in v0.1.0

func (h BucketHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (BucketHandler) BucketDelete added in v0.1.0

func (h BucketHandler) BucketDelete(ctx *gin.Context)

BucketDelete godoc @summary Delete bucket content by ID and path. @description Delete bucket content by ID and path. @tags buckets @produce json @success 204 @router /buckets/{id}/{wildcard} [delete] @param id path int true "Bucket ID" @param wildcard path string true "Content path"

func (BucketHandler) BucketGet added in v0.1.0

func (h BucketHandler) BucketGet(ctx *gin.Context)

BucketGet godoc @summary Get bucket content by ID and path. @description Get bucket content by ID and path. @description When path is FILE, returns file content. @description When path is DIRECTORY and Accept=text/html returns index.html. @description ?filter=glob supports directory content filtering. @description Else returns a tarball. @tags buckets @produce octet-stream @success 200 @router /buckets/{id}/{wildcard} [get] @param id path int true "Task ID" @param wildcard path string true "Content path" @param filter query string false "Filter"

func (BucketHandler) BucketPut added in v0.1.0

func (h BucketHandler) BucketPut(ctx *gin.Context)

BucketPut godoc @summary Upload bucket content by ID and path. @description Upload bucket content by ID and path (handles both [post] and [put] requests). @tags buckets @produce json @success 204 @router /buckets/{id}/{wildcard} [post] @param id path int true "Bucket ID" @param wildcard path string true "Content path"

func (BucketHandler) Create added in v0.1.0

func (h BucketHandler) Create(ctx *gin.Context)

Create godoc @summary Create a bucket. @description Create a bucket. @tags buckets @accept json @produce json @success 201 {object} api.Bucket @router /buckets [post] @param name path string true "Bucket name"

func (BucketHandler) Delete added in v0.1.0

func (h BucketHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a bucket. @description Delete a bucket. @tags buckets @success 204 @router /buckets/{id} [delete] @param id path int true "Bucket ID"

func (BucketHandler) Get added in v0.1.0

func (h BucketHandler) Get(ctx *gin.Context)

Get godoc @summary Get a bucket by ID. @description Get a bucket by ID. @description Returns api.Bucket when Accept=application/json. @description Else returns index.html when Accept=text/html. @description Else returns tarball. @tags buckets @produce octet-stream @success 200 {object} api.Bucket @router /buckets/{id} [get] @param id path int true "Bucket ID"

func (BucketHandler) List added in v0.1.0

func (h BucketHandler) List(ctx *gin.Context)

List godoc @summary List all buckets. @description List all buckets. @tags buckets @produce json @success 200 {object} []api.Bucket @router /buckets [get]

type BucketOwner added in v0.1.0

type BucketOwner struct {
	BaseHandler
}

type BusinessService

type BusinessService struct {
	Resource    `yaml:",inline"`
	Name        string `json:"name" binding:"required"`
	Description string `json:"description"`
	Stakeholder *Ref   `json:"owner"`
}

BusinessService REST resource.

func (*BusinessService) Model

func (r *BusinessService) Model() (m *model.BusinessService)

Model builds a model.

func (*BusinessService) With

With updates the resource with the model.

type BusinessServiceHandler

type BusinessServiceHandler struct {
	BaseHandler
}

BusinessServiceHandler handles business-service routes.

func (BusinessServiceHandler) AddRoutes

func (h BusinessServiceHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (BusinessServiceHandler) Create

func (h BusinessServiceHandler) Create(ctx *gin.Context)

Create godoc @summary Create a business service. @description Create a business service. @tags businessservices @accept json @produce json @success 201 {object} api.BusinessService @router /businessservices [post] @param business_service body api.BusinessService true "Business service data"

func (BusinessServiceHandler) Delete

func (h BusinessServiceHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a business service. @description Delete a business service. @tags businessservices @success 204 @router /businessservices/{id} [delete] @param id path int true "Business service ID"

func (BusinessServiceHandler) Get

func (h BusinessServiceHandler) Get(ctx *gin.Context)

Get godoc @summary Get a business service by ID. @description Get a business service by ID. @tags businessservices @produce json @success 200 {object} api.BusinessService @router /businessservices/{id} [get] @param id path int true "Business Service ID"

func (BusinessServiceHandler) List

func (h BusinessServiceHandler) List(ctx *gin.Context)

List godoc @summary List all business services. @description List all business services. @tags businessservices @produce json @success 200 {object} api.BusinessService @router /businessservices [get]

func (BusinessServiceHandler) Update

func (h BusinessServiceHandler) Update(ctx *gin.Context)

Update godoc @summary Update a business service. @description Update a business service. @tags businessservices @accept json @success 204 @router /businessservices/{id} [put] @param id path int true "Business service ID" @param business_service body api.BusinessService true "Business service data"

type Cache

type Cache struct {
	Path     string `json:"path"`
	Capacity string `json:"capacity"`
	Used     string `json:"used"`
	Exists   bool   `json:"exists"`
}

Cache REST resource.

type CacheHandler

type CacheHandler struct {
	BaseHandler
}

CacheHandler handles cache routes.

func (CacheHandler) AddRoutes

func (h CacheHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (CacheHandler) Delete

func (h CacheHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a directory within the cache. @description Delete a directory within the cache. @tags cache @produce json @success 204 @router /cache [delete]

func (CacheHandler) Get

func (h CacheHandler) Get(ctx *gin.Context)

Get godoc @summary Get the cache. @description Get the cache. @tags cache @produce json @success 200 {object} api.Cache @router /caches/{wildcard} [get] @param wildcard path string true "Cache DIR"

type Context added in v0.1.0

type Context struct {
	*gin.Context
	// DB client.
	DB *gorm.DB
	// User
	User string
	// Scope
	Scopes []auth.Scope
	// k8s Client
	Client client.Client
	// Response
	Response Response
}

Context custom settings.

func WithContext added in v0.1.0

func WithContext(ctx *gin.Context) (n *Context)

WithContext is a rich context.

func (*Context) Respond added in v0.2.0

func (r *Context) Respond(status int, body interface{})

Respond sets the values to respond to the request with.

func (*Context) Status added in v0.2.0

func (r *Context) Status(status int)

Status sets the values to respond to the request with.

type CopyRequest

type CopyRequest struct {
	SourceReview       uint   `json:"sourceReview" binding:"required"`
	TargetApplications []uint `json:"targetApplications" binding:"required"`
}

CopyRequest REST resource.

type Cursor added in v0.3.0

type Cursor struct {
	Page
	DB    *gorm.DB
	Rows  *sql.Rows
	Index int64
	Error error
}

Cursor Paginated rows iterator.

func (*Cursor) Close added in v0.3.0

func (r *Cursor) Close()

Close the cursor.

func (*Cursor) Count added in v0.3.0

func (r *Cursor) Count() (n int64)

Count returns the count adjusted for offset.

func (*Cursor) Next added in v0.3.0

func (r *Cursor) Next(m interface{}) (next bool)

Next returns true when has next row.

func (*Cursor) With added in v0.3.0

func (r *Cursor) With(db *gorm.DB, p Page)

With configures the cursor.

type Decoder added in v0.2.0

type Decoder interface {
	Decode(r interface{}) (err error)
}

Decoder binding decoder.

type DepAppReport added in v0.3.0

type DepAppReport struct {
	ID              uint   `json:"id"`
	Name            string `json:"name"`
	Description     string `json:"description"`
	BusinessService string `json:"businessService"`
	Dependency      struct {
		ID       uint     `json:"id"`
		Provider string   `json:"provider"`
		Name     string   `json:"name"`
		Version  string   `json:"version"`
		SHA      string   `json:"rule"`
		Indirect bool     `json:"indirect"`
		Labels   []string `json:"labels"`
	} `json:"dependency"`
}

DepAppReport REST resource.

type DepReport added in v0.2.0

type DepReport struct {
	Provider     string   `json:"provider"`
	Name         string   `json:"name"`
	Version      string   `json:"version"`
	SHA          string   `json:"sha"`
	Labels       []string `json:"labels"`
	Applications int      `json:"applications"`
}

DepReport REST resource.

type Dependency

type Dependency struct {
	Resource `yaml:",inline"`
	To       Ref `json:"to"`
	From     Ref `json:"from"`
}

Dependency REST resource.

func (*Dependency) Model

func (r *Dependency) Model() (m *model.Dependency)

Model builds a model.Dependency.

func (*Dependency) With

func (r *Dependency) With(m *model.Dependency)

With updates the resource using the model.

type DependencyGraph

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

DependencyGraph is an application dependency graph.

func NewDependencyGraph

func NewDependencyGraph() (graph DependencyGraph)

NewDependencyGraph creates an empty dependency graph.

func (*DependencyGraph) AddEdge

func (r *DependencyGraph) AddEdge(v, w uint)

AddEdge adds an edge between two vertices.

func (*DependencyGraph) AddVertex

func (r *DependencyGraph) AddVertex(v *Vertex)

AddVertex adds a vertex to the graph.

func (*DependencyGraph) CalculateCost

func (r *DependencyGraph) CalculateCost(v uint) (cumulativeCost int)

CalculateCost calculates the total cost to reach a given vertex. Costs are memoized.

func (*DependencyGraph) HasVertex

func (r *DependencyGraph) HasVertex(v uint) (ok bool)

HasVertex checks for the presence of a vertex in the graph.

func (*DependencyGraph) TopologicalSort

func (r *DependencyGraph) TopologicalSort() (sorted []*Vertex, ok bool)

TopologicalSort sorts the graph such that the vertices with fewer dependencies are first, and detects cycles.

type DependencyHandler

type DependencyHandler struct {
	BaseHandler
}

DependencyHandler handles application dependency routes.

func (DependencyHandler) AddRoutes

func (h DependencyHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (DependencyHandler) Create

func (h DependencyHandler) Create(ctx *gin.Context)

Create godoc @summary Create a dependency. @description Create a dependency. @tags dependencies @accept json @produce json @success 201 {object} api.Dependency @router /dependencies [post] @param applications_dependency body Dependency true "Dependency data"

func (DependencyHandler) Delete

func (h DependencyHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a dependency. @description Delete a dependency. @tags dependencies @accept json @success 204 @router /dependencies/{id} [delete] @param id path int true "Dependency id"

func (DependencyHandler) Get

func (h DependencyHandler) Get(ctx *gin.Context)

Get godoc @summary Get a dependency by ID. @description Get a dependency by ID. @tags dependencies @produce json @success 200 {object} api.Dependency @router /dependencies/{id} [get] @param id path int true "Dependency ID"

func (DependencyHandler) List

func (h DependencyHandler) List(ctx *gin.Context)

List godoc @summary List all dependencies. @description List all dependencies. @tags dependencies @produce json @success 200 {object} []api.Dependency @router /dependencies [get]

type Fact added in v0.1.0

type Fact struct {
	Key    string      `json:"key"`
	Value  interface{} `json:"value"`
	Source string      `json:"source"`
}

Fact REST nested resource.

func (*Fact) Model added in v0.1.0

func (r *Fact) Model() (m *model.Fact)

func (*Fact) With added in v0.1.0

func (r *Fact) With(m *model.Fact)

type FactKey added in v0.2.0

type FactKey string

FactKey is a fact source and fact name separated by a colon.

Example: 'analysis:languages'

A FactKey can be used to identify an anonymous fact.

Example: 'languages' or ':languages'

A FactKey can also be used to identify just a source. This use must include the trailing colon to distinguish it from an anonymous fact. This is used when listing or replacing all facts that belong to a source.

Example: 'analysis:"

func (FactKey) Name added in v0.2.0

func (r FactKey) Name() (name string)

Name returns the name portion of a fact key.

func (*FactKey) Qualify added in v0.2.0

func (r *FactKey) Qualify(source string)

Qualify qualifies the name with the source.

func (FactKey) Source added in v0.2.0

func (r FactKey) Source() (source string)

Source returns the source portion of a fact key.

type FactMap added in v0.1.0

type FactMap map[string]interface{}

FactMap map.

type Fields

type Fields map[string]interface{}

type File

type File struct {
	Resource   `yaml:",inline"`
	Name       string     `json:"name"`
	Path       string     `json:"path"`
	Expiration *time.Time `json:"expiration,omitempty"`
}

File REST resource.

func (*File) With added in v0.1.0

func (r *File) With(m *model.File)

With updates the resource with the model.

type FileHandler added in v0.1.0

type FileHandler struct {
	BaseHandler
}

FileHandler handles file routes.

func (FileHandler) AddRoutes added in v0.1.0

func (h FileHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (FileHandler) Create added in v0.1.0

func (h FileHandler) Create(ctx *gin.Context)

Create godoc @summary Create a file. @description Create a file. @tags file @accept json @produce json @success 201 {object} api.File @router /files [post] @param name path string true "File name"

func (FileHandler) Delete added in v0.1.0

func (h FileHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a file. @description Delete a file. @tags file @success 204 @router /files/{id} [delete] @param id path int true "File ID"

func (FileHandler) Get added in v0.1.0

func (h FileHandler) Get(ctx *gin.Context)

Get godoc @summary Get a file by ID. @description Get a file by ID. Returns api.File when Accept=application/json else the file content. @tags file @produce octet-stream @success 200 {object} api.File @router /files/{id} [get] @param id path int true "File ID"

func (FileHandler) List added in v0.1.0

func (h FileHandler) List(ctx *gin.Context)

List godoc @summary List all files. @description List all files. @tags file @produce json @success 200 {object} []api.File @router /files [get]

type FileReport added in v0.2.0

type FileReport struct {
	IssueID   uint   `json:"issueId" yaml:"issueId"`
	File      string `json:"file"`
	Incidents int    `json:"incidents"`
	Effort    int    `json:"effort"`
}

FileReport REST resource.

type Forbidden added in v0.3.0

type Forbidden struct {
	Reason string
}

Forbidden reports auth errors.

func (*Forbidden) Error added in v0.3.0

func (r *Forbidden) Error() string

func (*Forbidden) Is added in v0.3.0

func (r *Forbidden) Is(err error) (matched bool)

type Handler

type Handler interface {
	AddRoutes(e *gin.Engine)
}

Handler API.

func All

func All() []Handler

All builds all handlers.

type Identity

type Identity struct {
	Resource    `yaml:",inline"`
	Kind        string `json:"kind" binding:"required"`
	Name        string `json:"name" binding:"required"`
	Description string `json:"description"`
	User        string `json:"user"`
	Password    string `json:"password"`
	Key         string `json:"key"`
	Settings    string `json:"settings"`
}

Identity REST resource.

func (*Identity) Model

func (r *Identity) Model() (m *model.Identity)

Model builds a model.

func (*Identity) With

func (r *Identity) With(m *model.Identity)

With updates the resource with the model.

type IdentityHandler

type IdentityHandler struct {
	BaseHandler
}

IdentityHandler handles identity resource routes.

func (IdentityHandler) AddRoutes

func (h IdentityHandler) AddRoutes(e *gin.Engine)

func (IdentityHandler) Create

func (h IdentityHandler) Create(ctx *gin.Context)

Create godoc @summary Create an identity. @description Create an identity. @tags identities @accept json @produce json @success 201 {object} Identity @router /identities [post] @param identity body Identity true "Identity data"

func (IdentityHandler) Delete

func (h IdentityHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete an identity. @description Delete an identity. @tags identities @success 204 @router /identities/{id} [delete] @param id path int true "Identity ID"

func (IdentityHandler) Get

func (h IdentityHandler) Get(ctx *gin.Context)

Get godoc @summary Get an identity by ID. @description Get an identity by ID. @tags identities @produce json @success 200 {object} Identity @router /identities/{id} [get] @param id path int true "Identity ID"

func (IdentityHandler) List

func (h IdentityHandler) List(ctx *gin.Context)

List godoc @summary List all identities. @description List all identities. @tags identities @produce json @success 200 {object} []Identity @router /identities [get]

func (IdentityHandler) Update

func (h IdentityHandler) Update(ctx *gin.Context)

Update godoc @summary Update an identity. @description Update an identity. @tags identities @accept json @success 204 @router /identities/{id} [put] @param id path int true "Identity ID" @param identity body Identity true "Identity data"

type Import

type Import map[string]interface{}

Import REST resource.

type ImportHandler

type ImportHandler struct {
	BaseHandler
}

ImportHandler handles import routes.

func (ImportHandler) AddRoutes

func (h ImportHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (ImportHandler) DeleteImport

func (h ImportHandler) DeleteImport(ctx *gin.Context)

DeleteImport godoc @summary Delete an import. @description Delete an import. This leaves any created application or dependency. @tags imports @success 204 @router /imports/{id} [delete] @param id path int true "Import ID"

func (ImportHandler) DeleteSummary

func (h ImportHandler) DeleteSummary(ctx *gin.Context)

DeleteSummary godoc @summary Delete an import summary and associated import records. @description Delete an import summary and associated import records. @tags imports @success 204 @router /importsummaries/{id} [delete] @param id path int true "ImportSummary ID"

func (ImportHandler) DownloadCSV

func (h ImportHandler) DownloadCSV(ctx *gin.Context)

DownloadCSV godoc @summary Export the source CSV for a particular import summary. @description Export the source CSV for a particular import summary. @tags imports @produce text/csv @success 200 file csv @router /importsummaries/download [get] @param importSummary.id query string true "ImportSummary ID"

func (ImportHandler) GetImport

func (h ImportHandler) GetImport(ctx *gin.Context)

GetImport godoc @summary Get an import by ID. @description Get an import by ID. @tags imports @produce json @success 200 {object} api.Import @router /imports/{id} [get] @param id path int true "Import ID"

func (ImportHandler) GetSummary

func (h ImportHandler) GetSummary(ctx *gin.Context)

GetSummary godoc @summary Get an import summary by ID. @description Get an import by ID. @tags imports @produce json @success 200 {object} api.ImportSummary @router /importsummaries/{id} [get] @param id path int true "ImportSummary ID"

func (ImportHandler) ListImports

func (h ImportHandler) ListImports(ctx *gin.Context)

ListImports godoc @summary List imports. @description List imports. @tags imports @produce json @success 200 {object} []api.Import @router /imports [get]

func (ImportHandler) ListSummaries

func (h ImportHandler) ListSummaries(ctx *gin.Context)

ListSummaries godoc @summary List import summaries. @description List import summaries. @tags imports @produce json @success 200 {object} []api.ImportSummary @router /importsummaries [get]

func (ImportHandler) UploadCSV

func (h ImportHandler) UploadCSV(ctx *gin.Context)

UploadCSV godoc @summary Upload a CSV containing applications and dependencies to import. @description Upload a CSV containing applications and dependencies to import. @tags imports @success 201 {object} api.ImportSummary @produce json @router /importsummaries/upload [post]

type ImportSummary

type ImportSummary struct {
	Resource       `yaml:",inline"`
	Filename       string    `json:"filename"`
	ImportStatus   string    `json:"importStatus" yaml:"importStatus"`
	ImportTime     time.Time `json:"importTime" yaml:"importTime"`
	ValidCount     int       `json:"validCount" yaml:"validCount"`
	InvalidCount   int       `json:"invalidCount" yaml:"invalidCount"`
	CreateEntities bool      `json:"createEntities" yaml:"createEntities"`
}

ImportSummary REST resource.

func (*ImportSummary) With

func (r *ImportSummary) With(m *model.ImportSummary)

With updates the resource with the model.

type Incident added in v0.2.0

type Incident struct {
	Resource `yaml:",inline"`
	File     string  `json:"file"`
	Line     int     `json:"line"`
	Message  string  `json:"message"`
	CodeSnip string  `json:"codeSnip" yaml:"codeSnip"`
	Facts    FactMap `json:"facts"`
}

Incident REST resource.

func (*Incident) Model added in v0.2.0

func (r *Incident) Model() (m *model.Incident)

Model builds a model.

func (*Incident) With added in v0.2.0

func (r *Incident) With(m *model.Incident)

With updates the resource with the model.

type Issue added in v0.2.0

type Issue struct {
	Resource    `yaml:",inline"`
	RuleSet     string     `json:"ruleset" binding:"required"`
	Rule        string     `json:"rule" binding:"required"`
	Name        string     `json:"name" binding:"required"`
	Description string     `json:"description,omitempty" yaml:",omitempty"`
	Category    string     `json:"category" binding:"required"`
	Effort      int        `json:"effort,omitempty" yaml:",omitempty"`
	Incidents   []Incident `json:"incidents,omitempty" yaml:",omitempty"`
	Links       []Link     `json:"links,omitempty" yaml:",omitempty"`
	Facts       FactMap    `json:"facts,omitempty" yaml:",omitempty"`
	Labels      []string   `json:"labels"`
}

Issue REST resource.

func (*Issue) Model added in v0.2.0

func (r *Issue) Model() (m *model.Issue)

Model builds a model.

func (*Issue) With added in v0.2.0

func (r *Issue) With(m *model.Issue)

With updates the resource with the model.

type IssueAppReport added in v0.3.0

type IssueAppReport struct {
	ID              uint   `json:"id"`
	Name            string `json:"name"`
	Description     string `json:"description"`
	BusinessService string `json:"businessService"`
	Effort          int    `json:"effort"`
	Incidents       int    `json:"incidents"`
	Files           int    `json:"files"`
	Issue           struct {
		ID          uint   `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
		RuleSet     string `json:"ruleset"`
		Rule        string `json:"rule"`
	} `json:"issue"`
}

IssueAppReport REST resource.

type IssueReport added in v0.3.0

type IssueReport struct {
	ID          uint     `json:"id"`
	RuleSet     string   `json:"ruleset"`
	Rule        string   `json:"rule"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Category    string   `json:"category"`
	Effort      int      `json:"effort"`
	Labels      []string `json:"labels"`
	Links       []Link   `json:"links"`
	Files       int      `json:"files"`
}

IssueReport REST resource.

type IssueType added in v0.2.0

type IssueType struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

IssueType API Resource

func (*IssueType) With added in v0.2.0

func (r *IssueType) With(i *tracker.IssueType)

With updates the resource with the model.

type JobFunction

type JobFunction struct {
	Resource     `yaml:",inline"`
	Name         string `json:"name" binding:"required"`
	Stakeholders []Ref  `json:"stakeholders"`
}

JobFunction REST resource.

func (*JobFunction) Model

func (r *JobFunction) Model() (m *model.JobFunction)

Model builds a model.

func (*JobFunction) With

func (r *JobFunction) With(m *model.JobFunction)

With updates the resource with the model.

type JobFunctionHandler

type JobFunctionHandler struct {
	BaseHandler
}

JobFunctionHandler handles job-function routes.

func (JobFunctionHandler) AddRoutes

func (h JobFunctionHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (JobFunctionHandler) Create

func (h JobFunctionHandler) Create(ctx *gin.Context)

Create godoc @summary Create a job function. @description Create a job function. @tags jobfunctions @accept json @produce json @success 200 {object} api.JobFunction @router /jobfunctions [post] @param job_function body api.JobFunction true "Job Function data"

func (JobFunctionHandler) Delete

func (h JobFunctionHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a job function. @description Delete a job function. @tags jobfunctions @success 204 @router /jobfunctions/{id} [delete] @param id path int true "Job Function ID"

func (JobFunctionHandler) Get

func (h JobFunctionHandler) Get(ctx *gin.Context)

Get godoc @summary Get a job function by ID. @description Get a job function by ID. @tags jobfunctions @produce json @success 200 {object} api.JobFunction @router /jobfunctions/{id} [get] @param id path int true "Job Function ID"

func (JobFunctionHandler) List

func (h JobFunctionHandler) List(ctx *gin.Context)

List godoc @summary List all job functions. @description List all job functions. @tags jobfunctions @produce json @success 200 {object} []api.JobFunction @router /jobfunctions [get]

func (JobFunctionHandler) Update

func (h JobFunctionHandler) Update(ctx *gin.Context)

Update godoc @summary Update a job function. @description Update a job function. @tags jobfunctions @accept json @success 204 @router /jobfunctions/{id} [put] @param id path int true "Job Function ID" @param job_function body api.JobFunction true "Job Function data"

type Label added in v0.3.0

type Label struct {
	Name  string `json:"name"`
	Label string `json:"label"`
}
type Link struct {
	URL   string `json:"url"`
	Title string `json:"title,omitempty" yaml:",omitempty"`
}

Link analysis report link.

type Login

type Login struct {
	User     string `json:"user"`
	Password string `json:"password,omitempty"`
	Token    string `json:"token"`
	Refresh  string `json:"refresh"`
	Expiry   int    `json:"expiry"`
}

Login REST resource.

type MigrationWave added in v0.1.0

type MigrationWave struct {
	Resource          `yaml:",inline"`
	Name              string    `json:"name"`
	StartDate         time.Time `json:"startDate" yaml:"startDate"`
	EndDate           time.Time `json:"endDate" yaml:"endDate"`
	Applications      []Ref     `json:"applications"`
	Stakeholders      []Ref     `json:"stakeholders"`
	StakeholderGroups []Ref     `json:"stakeholderGroups" yaml:"stakeholderGroups"`
}

MigrationWave REST Resource

func (*MigrationWave) Model added in v0.1.0

func (r *MigrationWave) Model() (m *model.MigrationWave)

Model builds a model.

func (*MigrationWave) With added in v0.1.0

func (r *MigrationWave) With(m *model.MigrationWave)

With updates the resource using the model.

type MigrationWaveHandler added in v0.1.0

type MigrationWaveHandler struct {
	BaseHandler
}

MigrationWaveHandler handles Migration Wave resource routes.

func (MigrationWaveHandler) AddRoutes added in v0.1.0

func (h MigrationWaveHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (MigrationWaveHandler) Create added in v0.1.0

func (h MigrationWaveHandler) Create(ctx *gin.Context)

Create godoc @summary Create a migration wave. @description Create a migration wave. @tags migrationwaves @accept json @produce json @success 201 {object} api.MigrationWave @router /migrationwaves [post] @param migrationwave body api.MigrationWave true "Migration Wave data"

func (MigrationWaveHandler) Delete added in v0.1.0

func (h MigrationWaveHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a migration wave. @description Delete a migration wave. @tags migrationwaves @success 204 @router /migrationwaves/{id} [delete] @param id path int true "MigrationWave id"

func (MigrationWaveHandler) Get added in v0.1.0

func (h MigrationWaveHandler) Get(ctx *gin.Context)

Get godoc @summary Get a migration wave by ID. @description Get a migration wave by ID. @tags migrationwaves @produce json @success 200 {object} api.MigrationWave @router /migrationwaves/{id} [get] @param id path int true "Migration Wave ID"

func (MigrationWaveHandler) List added in v0.1.0

func (h MigrationWaveHandler) List(ctx *gin.Context)

List godoc @summary List all migration waves. @description List all migration waves. @tags migrationwaves @produce json @success 200 {object} []api.MigrationWave @router /migrationwaves [get]

func (MigrationWaveHandler) Update added in v0.1.0

func (h MigrationWaveHandler) Update(ctx *gin.Context)

Update godoc @summary Update a migration wave. @description Update a migration wave. @tags migrationwaves @accept json @success 204 @router /migrationwaves/{id} [put] @param id path int true "MigrationWave id" @param migrationWave body api.MigrationWave true "MigrationWave data"

type Page added in v0.2.0

type Page struct {
	Offset int
	Limit  int
}

Page provides pagination.

func (*Page) Paginated added in v0.2.0

func (p *Page) Paginated(in *gorm.DB) (out *gorm.DB)

Paginated returns a paginated DB.

func (*Page) With added in v0.2.0

func (p *Page) With(ctx *gin.Context)

With context.

type Project added in v0.2.0

type Project struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Project API Resource

func (*Project) With added in v0.2.0

func (r *Project) With(i *tracker.Project)

With updates the resource with the model.

type Proxy

type Proxy struct {
	Resource `yaml:",inline"`
	Enabled  bool     `json:"enabled"`
	Kind     string   `json:"kind" binding:"oneof=http https"`
	Host     string   `json:"host"`
	Port     int      `json:"port"`
	Excluded []string `json:"excluded"`
	Identity *Ref     `json:"identity"`
}

Proxy REST resource.

func (*Proxy) Model

func (r *Proxy) Model() (m *model.Proxy)

Model builds a model.

func (*Proxy) With

func (r *Proxy) With(m *model.Proxy)

With updates the resource with the model.

type ProxyHandler

type ProxyHandler struct {
	BaseHandler
}

ProxyHandler handles proxy resource routes.

func (ProxyHandler) AddRoutes

func (h ProxyHandler) AddRoutes(e *gin.Engine)

func (ProxyHandler) Create

func (h ProxyHandler) Create(ctx *gin.Context)

Create godoc @summary Create an proxy. @description Create an proxy. @tags proxies @accept json @produce json @success 201 {object} Proxy @router /proxies [post] @param proxy body Proxy true "Proxy data"

func (ProxyHandler) Delete

func (h ProxyHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete an proxy. @description Delete an proxy. @tags proxies @success 204 @router /proxies/{id} [delete] @param id path int true "Proxy ID"

func (ProxyHandler) Get

func (h ProxyHandler) Get(ctx *gin.Context)

Get godoc @summary Get an proxy by ID. @description Get an proxy by ID. @tags proxies @produce json @success 200 {object} Proxy @router /proxies/{id} [get] @param id path int true "Proxy ID"

func (ProxyHandler) List

func (h ProxyHandler) List(ctx *gin.Context)

List godoc @summary List all proxies. @description List all proxies. @tags proxies @produce json @success 200 {object} []Proxy @router /proxies [get]

func (ProxyHandler) Update

func (h ProxyHandler) Update(ctx *gin.Context)

Update godoc @summary Update an proxy. @description Update an proxy. @tags proxies @accept json @success 204 @router /proxies/{id} [put] @param id path int true "Proxy ID" @param proxy body Proxy true "Proxy data"

type Questionnaire added in v0.3.0

type Questionnaire struct {
	Resource     `yaml:",inline"`
	Name         string                  `json:"name" yaml:"name" binding:"required"`
	Description  string                  `json:"description" yaml:"description"`
	Required     bool                    `json:"required" yaml:"required"`
	Sections     []assessment.Section    `json:"sections" yaml:"sections" binding:"required"`
	Thresholds   assessment.Thresholds   `json:"thresholds" yaml:"thresholds" binding:"required"`
	RiskMessages assessment.RiskMessages `json:"riskMessages" yaml:"riskMessages" binding:"required"`
	Builtin      bool                    `json:"builtin,omitempty" yaml:"builtin,omitempty"`
}

func (*Questionnaire) Model added in v0.3.0

func (r *Questionnaire) Model() (m *model.Questionnaire)

Model builds a model.

func (*Questionnaire) With added in v0.3.0

func (r *Questionnaire) With(m *model.Questionnaire)

With updates the resource with the model.

type QuestionnaireHandler added in v0.3.0

type QuestionnaireHandler struct {
	BaseHandler
}

QuestionnaireHandler handles Questionnaire resource routes.

func (QuestionnaireHandler) AddRoutes added in v0.3.0

func (h QuestionnaireHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (QuestionnaireHandler) Create added in v0.3.0

func (h QuestionnaireHandler) Create(ctx *gin.Context)

Create godoc @summary Create a questionnaire. @description Create a questionnaire. @tags questionnaires @accept json @produce json @success 200 {object} api.Questionnaire @router /questionnaires [post] @param questionnaire body api.Questionnaire true "Questionnaire data"

func (QuestionnaireHandler) Delete added in v0.3.0

func (h QuestionnaireHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a questionnaire. @description Delete a questionnaire. @tags questionnaires @success 204 @router /questionnaires/{id} [delete] @param id path int true "Questionnaire ID"

func (QuestionnaireHandler) Get added in v0.3.0

func (h QuestionnaireHandler) Get(ctx *gin.Context)

Get godoc @summary Get a questionnaire by ID. @description Get a questionnaire by ID. @tags questionnaires @produce json @success 200 {object} api.Questionnaire @router /questionnaires/{id} [get] @param id path int true "Questionnaire ID"

func (QuestionnaireHandler) List added in v0.3.0

func (h QuestionnaireHandler) List(ctx *gin.Context)

List godoc @summary List all questionnaires. @description List all questionnaires. @tags questionnaires @produce json @success 200 {object} []api.Questionnaire @router /questionnaires [get]

func (QuestionnaireHandler) Update added in v0.3.0

func (h QuestionnaireHandler) Update(ctx *gin.Context)

Update godoc @summary Update a questionnaire. @description Update a questionnaire. If the Questionnaire @description is builtin, only its "required" field can be changed @description and all other fields will be ignored. @tags questionnaires @accept json @success 204 @router /questionnaires/{id} [put] @param id path int true "Questionnaire ID" @param questionnaire body api.Questionnaire true "Questionnaire data"

type Ref

type Ref struct {
	ID   uint   `json:"id" binding:"required"`
	Name string `json:"name,omitempty"`
}

Ref represents a FK. Contains the PK and (name) natural key. The name is optional and read-only.

func (*Ref) With

func (r *Ref) With(id uint, name string)

With id and named model.

type ReportWriter added in v0.3.0

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

ReportWriter analysis report writer.

func (*ReportWriter) Write added in v0.3.0

func (r *ReportWriter) Write(id uint)

Write builds and streams the analysis report.

type Repository

type Repository struct {
	Kind   string `json:"kind"`
	URL    string `json:"url"`
	Branch string `json:"branch"`
	Tag    string `json:"tag"`
	Path   string `json:"path"`
}

Repository REST nested resource.

type Resource

type Resource struct {
	ID         uint      `json:"id,omitempty" yaml:"id,omitempty"`
	CreateUser string    `json:"createUser" yaml:"createUser,omitempty"`
	UpdateUser string    `json:"updateUser" yaml:"updateUser,omitempty"`
	CreateTime time.Time `json:"createTime" yaml:"createTime,omitempty"`
}

REST resource.

func (*Resource) With

func (r *Resource) With(m *model.Model)

With updates the resource with the model.

type Response added in v0.2.0

type Response struct {
	Status int
	Body   interface{}
}

Response values.

type Review

type Review struct {
	Resource            `yaml:",inline"`
	BusinessCriticality uint   `json:"businessCriticality" yaml:"businessCriticality"`
	EffortEstimate      string `json:"effortEstimate" yaml:"effortEstimate"`
	ProposedAction      string `json:"proposedAction" yaml:"proposedAction"`
	WorkPriority        uint   `json:"workPriority" yaml:"workPriority"`
	Comments            string `json:"comments"`
	Application         *Ref   `json:"application,omitempty" binding:"required_without=Archetype,excluded_with=Archetype"`
	Archetype           *Ref   `json:"archetype,omitempty" binding:"required_without=Application,excluded_with=Application"`
}

Review REST resource.

func (*Review) Model

func (r *Review) Model() (m *model.Review)

Model builds a model.

func (*Review) With

func (r *Review) With(m *model.Review)

With updates the resource with the model.

type ReviewHandler

type ReviewHandler struct {
	BaseHandler
}

ReviewHandler handles review routes.

func (ReviewHandler) AddRoutes

func (h ReviewHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (ReviewHandler) CopyReview

func (h ReviewHandler) CopyReview(ctx *gin.Context)

CopyReview godoc @summary Copy a review from one application to others. @description Copy a review from one application to others. @tags reviews @accept json @success 204 @router /reviews/copy [post] @param copy_request body api.CopyRequest true "Review copy request data"

func (ReviewHandler) Create

func (h ReviewHandler) Create(ctx *gin.Context)

Create godoc @summary Create a review. @description Create a review. @tags reviews @accept json @produce json @success 201 {object} api.Review @router /reviews [post] @param review body api.Review true "Review data"

func (ReviewHandler) Delete

func (h ReviewHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a review. @description Delete a review. @tags reviews @success 204 @router /reviews/{id} [delete] @param id path int true "Review ID"

func (ReviewHandler) Get

func (h ReviewHandler) Get(ctx *gin.Context)

Get godoc @summary Get a review by ID. @description Get a review by ID. @tags reviews @produce json @success 200 {object} api.Review @router /reviews/{id} [get] @param id path int true "Review ID"

func (ReviewHandler) List

func (h ReviewHandler) List(ctx *gin.Context)

List godoc @summary List all reviews. @description List all reviews. @tags reviews @produce json @success 200 {object} []api.Review @router /reviews [get]

func (ReviewHandler) Update

func (h ReviewHandler) Update(ctx *gin.Context)

Update godoc @summary Update a review. @description Update a review. @tags reviews @accept json @success 204 @router /reviews/{id} [put] @param id path int true "Review ID" @param review body api.Review true "Review data"

type Rule added in v0.2.0

type Rule struct {
	Resource    `yaml:",inline"`
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	Labels      []string `json:"labels,omitempty"`
	File        *Ref     `json:"file,omitempty"`
}

Rule - REST Resource.

func (*Rule) Model added in v0.2.0

func (r *Rule) Model() (m *model.Rule)

Model builds a model.

func (*Rule) With added in v0.2.0

func (r *Rule) With(m *model.Rule)

With updates the resource with the model.

type RuleReport added in v0.2.0

type RuleReport struct {
	RuleSet      string   `json:"ruleset"`
	Rule         string   `json:"rule"`
	Name         string   `json:"name"`
	Description  string   `json:"description"`
	Category     string   `json:"category"`
	Effort       int      `json:"effort"`
	Labels       []string `json:"labels"`
	Links        []Link   `json:"links"`
	Applications int      `json:"applications"`
}

RuleReport REST resource.

type RuleSet added in v0.1.0

type RuleSet struct {
	Resource    `yaml:",inline"`
	Kind        string      `json:"kind,omitempty"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Rules       []Rule      `json:"rules"`
	Repository  *Repository `json:"repository,omitempty"`
	Identity    *Ref        `json:"identity,omitempty"`
	DependsOn   []Ref       `json:"dependsOn" yaml:"dependsOn"`
}

RuleSet REST resource.

func (*RuleSet) HasRule added in v0.2.0

func (r *RuleSet) HasRule(id uint) (b bool)

HasRule - determine if the ruleset is referenced.

func (*RuleSet) Model added in v0.1.0

func (r *RuleSet) Model() (m *model.RuleSet)

Model builds a model.

func (*RuleSet) With added in v0.1.0

func (r *RuleSet) With(m *model.RuleSet)

With updates the resource with the model.

type RuleSetHandler added in v0.2.0

type RuleSetHandler struct {
	BaseHandler
}

RuleSetHandler handles ruleset resource routes.

func (RuleSetHandler) AddRoutes added in v0.2.0

func (h RuleSetHandler) AddRoutes(e *gin.Engine)

func (RuleSetHandler) Create added in v0.2.0

func (h RuleSetHandler) Create(ctx *gin.Context)

Create godoc @summary Create a ruleset. @description Create a ruleset. @tags rulesets @accept json @produce json @success 201 {object} RuleSet @router /rulesets [post] @param ruleBundle body RuleSet true "RuleSet data"

func (RuleSetHandler) Delete added in v0.2.0

func (h RuleSetHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a ruleset. @description Delete a ruleset. @tags rulesets @success 204 @router /rulesets/{id} [delete] @param id path int true "RuleSet ID"

func (RuleSetHandler) Get added in v0.2.0

func (h RuleSetHandler) Get(ctx *gin.Context)

Get godoc @summary Get a RuleSet by ID. @description Get a RuleSet by ID. @tags rulesets @produce json @success 200 {object} RuleSet @router /rulesets/{id} [get] @param id path int true "RuleSet ID"

func (RuleSetHandler) List added in v0.2.0

func (h RuleSetHandler) List(ctx *gin.Context)

List godoc @summary List all bindings. @description List all bindings. @description filters: @description - name @description - labels @tags rulesets @produce json @success 200 {object} []RuleSet @router /rulesets [get]

func (RuleSetHandler) Update added in v0.2.0

func (h RuleSetHandler) Update(ctx *gin.Context)

Update godoc @summary Update a ruleset. @description Update a ruleset. @tags rulesets @accept json @success 204 @router /rulesets/{id} [put] @param id path int true "RuleSet ID" @param ruleBundle body RuleSet true "RuleSet data"

type Schema

type Schema struct {
	Version string   `json:"version,omitempty"`
	Paths   []string `json:"paths"`
}

type SchemaHandler

type SchemaHandler struct {
	BaseHandler

	// Schema version
	Version string
	// contains filtered or unexported fields
}

SchemaHandler providers schema (route) handler.

func (*SchemaHandler) AddRoutes

func (h *SchemaHandler) AddRoutes(r *gin.Engine)

AddRoutes Adds routes.

func (*SchemaHandler) Get

func (h *SchemaHandler) Get(ctx *gin.Context)

Get godoc @summary Get the API schema. @description Get the API schema. @tags schema @produce json @success 200 {object} Schema @router /schema [get]

type Setting

type Setting struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

Setting REST Resource

func (*Setting) Model

func (r *Setting) Model() (m *model.Setting)

func (*Setting) With

func (r *Setting) With(m *model.Setting)

type SettingHandler

type SettingHandler struct {
	BaseHandler
}

SettingHandler handles setting routes.

func (SettingHandler) AddRoutes

func (h SettingHandler) AddRoutes(e *gin.Engine)

AddRoutes add routes.

func (SettingHandler) Create

func (h SettingHandler) Create(ctx *gin.Context)

Create godoc @summary Create a setting. @description Create a setting. @tags settings @accept json @produce json @success 201 {object} api.Setting @router /settings [post] @param setting body api.Setting true "Setting data"

func (SettingHandler) CreateByKey added in v0.1.0

func (h SettingHandler) CreateByKey(ctx *gin.Context)

CreateByKey godoc @summary Create a setting. @description Create a setting. @tags settings @accept json @success 201 @router /settings/{key} [post] @param key path string true "Key" @param setting body api.Setting true "Setting value"

func (SettingHandler) Delete

func (h SettingHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a setting. @description Delete a setting. @tags settings @success 204 @router /settings/{key} [delete] @param key path string true "Key"

func (SettingHandler) Get

func (h SettingHandler) Get(ctx *gin.Context)

Get godoc @summary Get a setting by its key. @description Get a setting by its key. @tags settings @produce json @success 200 {object} api.Setting @router /settings/{key} [get] @param key path string true "Key"

func (SettingHandler) List

func (h SettingHandler) List(ctx *gin.Context)

List godoc @summary List all settings. @description List all settings. @tags settings @produce json @success 200 array api.Setting @router /settings [get]

func (SettingHandler) Update

func (h SettingHandler) Update(ctx *gin.Context)

Update godoc @summary Update a setting. @description Update a setting. @tags settings @accept json @produce json @success 204 @router /settings/{key} [put] @param key path string true "Key"

type Sort added in v0.2.0

type Sort = sort.Sort

Sort provides sorting.

type Stakeholder

type Stakeholder struct {
	Resource         `yaml:",inline"`
	Name             string `json:"name" binding:"required"`
	Email            string `json:"email" binding:"required"`
	Groups           []Ref  `json:"stakeholderGroups" yaml:"stakeholderGroups"`
	BusinessServices []Ref  `json:"businessServices" yaml:"businessServices"`
	JobFunction      *Ref   `json:"jobFunction" yaml:"jobFunction"`
	Owns             []Ref  `json:"owns"`
	Contributes      []Ref  `json:"contributes"`
	MigrationWaves   []Ref  `json:"migrationWaves" yaml:"migrationWaves"`
}

Stakeholder REST resource.

func (*Stakeholder) Model

func (r *Stakeholder) Model() (m *model.Stakeholder)

Model builds a model.

func (*Stakeholder) With

func (r *Stakeholder) With(m *model.Stakeholder)

With updates the resource with the model.

type StakeholderGroup

type StakeholderGroup struct {
	Resource       `yaml:",inline"`
	Name           string `json:"name" binding:"required"`
	Description    string `json:"description"`
	Stakeholders   []Ref  `json:"stakeholders"`
	MigrationWaves []Ref  `json:"migrationWaves" yaml:"migrationWaves"`
}

StakeholderGroup REST resource.

func (*StakeholderGroup) Model

func (r *StakeholderGroup) Model() (m *model.StakeholderGroup)

Model builds a model.

func (*StakeholderGroup) With

With updates the resource with the model.

type StakeholderGroupHandler

type StakeholderGroupHandler struct {
	BaseHandler
}

StakeholderGroupHandler handles stakeholder group routes.

func (StakeholderGroupHandler) AddRoutes

func (h StakeholderGroupHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (StakeholderGroupHandler) Create

func (h StakeholderGroupHandler) Create(ctx *gin.Context)

Create godoc @summary Create a stakeholder group. @description Create a stakeholder group. @tags stakeholdergroups @accept json @produce json @success 201 {object} api.StakeholderGroup @router /stakeholdergroups [post] @param stakeholder_group body api.StakeholderGroup true "Stakeholder Group data"

func (StakeholderGroupHandler) Delete

func (h StakeholderGroupHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a stakeholder group. @description Delete a stakeholder group. @tags stakeholdergroups @success 204 @router /stakeholdergroups/{id} [delete] @param id path int true "Stakeholder Group ID"

func (StakeholderGroupHandler) Get

func (h StakeholderGroupHandler) Get(ctx *gin.Context)

Get godoc @summary Get a stakeholder group by ID. @description Get a stakeholder group by ID. @tags stakeholdergroups @produce json @success 200 {object} api.StakeholderGroup @router /stakeholdergroups/{id} [get] @param id path int true "Stakeholder Group ID"

func (StakeholderGroupHandler) List

func (h StakeholderGroupHandler) List(ctx *gin.Context)

List godoc @summary List all stakeholder groups. @description List all stakeholder groups. @tags stakeholdergroups @produce json @success 200 {object} []api.StakeholderGroup @router /stakeholdergroups [get]

func (StakeholderGroupHandler) Update

func (h StakeholderGroupHandler) Update(ctx *gin.Context)

Update godoc @summary Update a stakeholder group. @description Update a stakeholder group. @tags stakeholdergroups @accept json @success 204 @router /stakeholdergroups/{id} [put] @param id path int true "Stakeholder Group ID" @param stakeholder_group body api.StakeholderGroup true "Stakeholder Group data"

type StakeholderHandler

type StakeholderHandler struct {
	BaseHandler
}

StakeholderHandler handles stakeholder routes.

func (StakeholderHandler) AddRoutes

func (h StakeholderHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (StakeholderHandler) Create

func (h StakeholderHandler) Create(ctx *gin.Context)

Create godoc @summary Create a stakeholder. @description Create a stakeholder. @tags stakeholders @accept json @produce json @success 201 {object} api.Stakeholder @router /stakeholders [post] @param stakeholder body api.Stakeholder true "Stakeholder data"

func (StakeholderHandler) Delete

func (h StakeholderHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a stakeholder. @description Delete a stakeholder. @tags stakeholders @success 204 @router /stakeholders/{id} [delete] @param id path int true "Stakeholder ID"

func (StakeholderHandler) Get

func (h StakeholderHandler) Get(ctx *gin.Context)

Get godoc @summary Get a stakeholder by ID. @description Get a stakeholder by ID. @tags stakeholders @produce json @success 200 {object} api.Stakeholder @router /stakeholders/{id} [get] @param id path int true "Stakeholder ID"

func (StakeholderHandler) List

func (h StakeholderHandler) List(ctx *gin.Context)

List godoc @summary List all stakeholders. @description List all stakeholders. @tags stakeholders @produce json @success 200 {object} []api.Stakeholder @router /stakeholders [get]

func (StakeholderHandler) Update

func (h StakeholderHandler) Update(ctx *gin.Context)

Update godoc @summary Update a stakeholder. @description Update a stakeholder. @tags stakeholders @accept json @success 204 @router /stakeholders/{id} [put] @param id path int true "Stakeholder ID" @param stakeholder body api.Stakeholder true "Stakeholder data"

type Stakeholders added in v0.1.0

type Stakeholders struct {
	Owner        *Ref  `json:"owner"`
	Contributors []Ref `json:"contributors"`
}

Stakeholders REST subresource.

type TTL

type TTL struct {
	Created   int `json:"created,omitempty"`
	Pending   int `json:"pending,omitempty"`
	Postponed int `json:"postponed,omitempty"`
	Running   int `json:"running,omitempty"`
	Succeeded int `json:"succeeded,omitempty"`
	Failed    int `json:"failed,omitempty"`
}

TTL time-to-live.

type Tag

type Tag struct {
	Resource `yaml:",inline"`
	Name     string `json:"name" binding:"required"`
	Category Ref    `json:"category" binding:"required"`
}

Tag REST resource.

func (*Tag) Model

func (r *Tag) Model() (m *model.Tag)

Model builds a model.

func (*Tag) With

func (r *Tag) With(m *model.Tag)

With updates the resource with the model.

type TagCategory added in v0.1.0

type TagCategory struct {
	Resource `yaml:",inline"`
	Name     string `json:"name" binding:"required"`
	Username string `json:"username"`
	Rank     uint   `json:"rank"`
	Color    string `json:"colour"`
	Tags     []Ref  `json:"tags"`
}

TagCategory REST resource.

func (*TagCategory) Model added in v0.1.0

func (r *TagCategory) Model() (m *model.TagCategory)

Model builds a model.

func (*TagCategory) With added in v0.1.0

func (r *TagCategory) With(m *model.TagCategory)

With updates the resource with the model.

type TagCategoryHandler added in v0.1.0

type TagCategoryHandler struct {
	BaseHandler
}

TagCategoryHandler handles the tag-type route.

func (TagCategoryHandler) AddRoutes added in v0.1.0

func (h TagCategoryHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (TagCategoryHandler) Create added in v0.1.0

func (h TagCategoryHandler) Create(ctx *gin.Context)

Create godoc @summary Create a tag category. @description Create a tag category. @tags tagcategories @accept json @produce json @success 201 {object} api.TagCategory @router /tagcategories [post] @param tag_type body api.TagCategory true "Tag Category data"

func (TagCategoryHandler) Delete added in v0.1.0

func (h TagCategoryHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a tag category. @description Delete a tag category. @tags tagcategories @success 204 @router /tagcategories/{id} [delete] @param id path int true "Tag Category ID"

func (TagCategoryHandler) Get added in v0.1.0

func (h TagCategoryHandler) Get(ctx *gin.Context)

Get godoc @summary Get a tag category by ID. @description Get a tag category by ID. @tags tagcategories @produce json @success 200 {object} api.TagCategory @router /tagcategories/{id} [get] @param id path int true "Tag Category ID"

func (TagCategoryHandler) List added in v0.1.0

func (h TagCategoryHandler) List(ctx *gin.Context)

List godoc @summary List all tag categories. @description List all tag categories. @tags tagcategories @produce json @success 200 {object} []api.TagCategory @router /tagcategories [get] @param name query string false "Optional category name filter"

func (TagCategoryHandler) TagList added in v0.2.0

func (h TagCategoryHandler) TagList(ctx *gin.Context)

TagList godoc @summary List the tags in the tag category. @description List the tags in the tag category. @tags tagcategories @produce json @success 200 {object} []api.Tag @router /tagcategories/{id}/tags [get] @param id path int true "Tag Category ID" @param name query string false "Optional tag name filter"

func (TagCategoryHandler) Update added in v0.1.0

func (h TagCategoryHandler) Update(ctx *gin.Context)

Update godoc @summary Update a tag category. @description Update a tag category. @tags tagcategories @accept json @success 204 @router /tagcategories/{id} [put] @param id path int true "Tag Category ID" @param tag_type body api.TagCategory true "Tag Category data"

type TagHandler

type TagHandler struct {
	BaseHandler
}

TagHandler handles tag routes.

func (TagHandler) AddRoutes

func (h TagHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (TagHandler) Create

func (h TagHandler) Create(ctx *gin.Context)

Create godoc @summary Create a tag. @description Create a tag. @tags tags @accept json @produce json @success 201 {object} api.Tag @router /tags [post] @param tag body Tag true "Tag data"

func (TagHandler) Delete

func (h TagHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a tag. @description Delete a tag. @tags tags @success 204 @router /tags/{id} [delete] @param id path int true "Tag ID"

func (TagHandler) Get

func (h TagHandler) Get(ctx *gin.Context)

Get godoc @summary Get a tag by ID. @description Get a tag by ID. @tags tags @produce json @success 200 {object} api.Tag @router /tags/{id} [get] @param id path int true "Tag ID"

func (TagHandler) List

func (h TagHandler) List(ctx *gin.Context)

List godoc @summary List all tags. @description List all tags. @tags tags @produce json @success 200 {object} []api.Tag @router /tags [get]

func (TagHandler) Update

func (h TagHandler) Update(ctx *gin.Context)

Update godoc @summary Update a tag. @description Update a tag. @tags tags @accept json @success 204 @router /tags/{id} [put] @param id path int true "Tag ID" @param tag body api.Tag true "Tag data"

type TagRef added in v0.1.0

type TagRef struct {
	ID      uint   `json:"id" binding:"required"`
	Name    string `json:"name"`
	Source  string `json:"source,omitempty" yaml:"source,omitempty"`
	Virtual bool   `json:"virtual,omitempty" yaml:"virtual,omitempty"`
}

TagRef represents a reference to a Tag. Contains the tag ID, name, tag source.

func (*TagRef) With added in v0.1.0

func (r *TagRef) With(id uint, name string, source string, virtual bool)

With id and named model.

type Target added in v0.3.0

type Target struct {
	Resource    `yaml:",inline"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Provider    string   `json:"provider,omitempty" yaml:",omitempty"`
	Choice      bool     `json:"choice,omitempty" yaml:",omitempty"`
	Custom      bool     `json:"custom,omitempty" yaml:",omitempty"`
	Labels      []Label  `json:"labels"`
	Image       Ref      `json:"image"`
	RuleSet     *RuleSet `json:"ruleset,omitempty" yaml:"ruleset,omitempty"`
}

Target REST resource.

func (*Target) Model added in v0.3.0

func (r *Target) Model() (m *model.Target)

Model builds a model.

func (*Target) With added in v0.3.0

func (r *Target) With(m *model.Target)

With updates the resource with the model.

type TargetHandler added in v0.3.0

type TargetHandler struct {
	BaseHandler
}

TargetHandler handles Target resource routes.

func (TargetHandler) AddRoutes added in v0.3.0

func (h TargetHandler) AddRoutes(e *gin.Engine)

func (TargetHandler) Create added in v0.3.0

func (h TargetHandler) Create(ctx *gin.Context)

Create godoc @summary Create a target. @description Create a target. @tags targets @accept json @produce json @success 201 {object} Target @router /targets [post] @param target body Target true "Target data"

func (TargetHandler) Delete added in v0.3.0

func (h TargetHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a target. @description Delete a target. @tags targets @success 204 @router /targets/{id} [delete] @param id path int true "Target ID"

func (TargetHandler) Get added in v0.3.0

func (h TargetHandler) Get(ctx *gin.Context)

Get godoc @summary Get a Target by ID. @description Get a Target by ID. @tags targets @produce json @success 200 {object} Target @router /targets/{id} [get] @param id path int true "Target ID"

func (TargetHandler) List added in v0.3.0

func (h TargetHandler) List(ctx *gin.Context)

List godoc @summary List all targets. @description List all targets. @tags targets @produce json @success 200 {object} []Target @router /targets [get]

func (TargetHandler) Update added in v0.3.0

func (h TargetHandler) Update(ctx *gin.Context)

Update godoc @summary Update a target. @description Update a target. @tags targets @accept json @success 204 @router /targets/{id} [put] @param id path int true "Target ID" @param target body Target true "Target data"

type Task

type Task struct {
	Resource    `yaml:",inline"`
	Name        string      `json:"name"`
	Locator     string      `json:"locator,omitempty" yaml:",omitempty"`
	Priority    int         `json:"priority,omitempty" yaml:",omitempty"`
	Variant     string      `json:"variant,omitempty" yaml:",omitempty"`
	Policy      string      `json:"policy,omitempty" yaml:",omitempty"`
	TTL         *TTL        `json:"ttl,omitempty" yaml:",omitempty"`
	Addon       string      `json:"addon,omitempty" binding:"required" yaml:",omitempty"`
	Data        interface{} `json:"data" swaggertype:"object" binding:"required"`
	Application *Ref        `json:"application,omitempty" yaml:",omitempty"`
	State       string      `json:"state"`
	Image       string      `json:"image,omitempty" yaml:",omitempty"`
	Pod         string      `json:"pod,omitempty" yaml:",omitempty"`
	Retries     int         `json:"retries,omitempty" yaml:",omitempty"`
	Started     *time.Time  `json:"started,omitempty" yaml:",omitempty"`
	Terminated  *time.Time  `json:"terminated,omitempty" yaml:",omitempty"`
	Canceled    bool        `json:"canceled,omitempty" yaml:",omitempty"`
	Bucket      *Ref        `json:"bucket,omitempty" yaml:",omitempty"`
	Purged      bool        `json:"purged,omitempty" yaml:",omitempty"`
	Errors      []TaskError `json:"errors,omitempty" yaml:",omitempty"`
	Activity    []string    `json:"activity,omitempty" yaml:",omitempty"`
}

Task REST resource.

func (*Task) Model

func (r *Task) Model() (m *model.Task)

Model builds a model.

func (*Task) With

func (r *Task) With(m *model.Task)

With updates the resource with the model.

type TaskError added in v0.3.0

type TaskError struct {
	Severity    string `json:"severity"`
	Description string `json:"description"`
}

TaskError used in Task.Errors.

type TaskGroup

type TaskGroup struct {
	Resource `yaml:",inline"`
	Name     string      `json:"name"`
	Addon    string      `json:"addon"`
	Data     interface{} `json:"data" swaggertype:"object" binding:"required"`
	Bucket   *Ref        `json:"bucket,omitempty"`
	State    string      `json:"state"`
	Tasks    []Task      `json:"tasks"`
}

TaskGroup REST resource.

func (*TaskGroup) Model

func (r *TaskGroup) Model() (m *model.TaskGroup)

Model builds a model.

func (*TaskGroup) With

func (r *TaskGroup) With(m *model.TaskGroup)

With updates the resource with the model.

type TaskGroupHandler

type TaskGroupHandler struct {
	BucketOwner
}

TaskGroupHandler handles task group routes.

func (TaskGroupHandler) AddRoutes

func (h TaskGroupHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (TaskGroupHandler) BucketDelete

func (h TaskGroupHandler) BucketDelete(ctx *gin.Context)

BucketDelete godoc @summary Delete bucket content by ID and path. @description Delete bucket content by ID and path. @tags taskgroups @produce json @success 204 @router /taskgroups/{id}/bucket/{wildcard} [delete] @param id path int true "Task ID" @param wildcard path string true "Content path"

func (TaskGroupHandler) BucketGet

func (h TaskGroupHandler) BucketGet(ctx *gin.Context)

BucketGet godoc @summary Get bucket content by ID and path. @description Get bucket content by ID and path. @description Returns index.html for directories when Accept=text/html else a tarball. @description ?filter=glob supports directory content filtering. @tags taskgroups @produce octet-stream @success 200 @router /taskgroups/{id}/bucket/{wildcard} [get] @param id path int true "TaskGroup ID" @param wildcard path string true "Content path" @param filter query string false "Filter"

func (TaskGroupHandler) BucketPut added in v0.1.0

func (h TaskGroupHandler) BucketPut(ctx *gin.Context)

BucketPut godoc @summary Upload bucket content by ID and path. @description Upload bucket content by ID and path (handles both [post] and [put] requests). @tags taskgroups @produce json @success 204 @router /taskgroups/{id}/bucket/{wildcard} [post] @param id path int true "TaskGroup ID" @param wildcard path string true "Content path"

func (TaskGroupHandler) Create

func (h TaskGroupHandler) Create(ctx *gin.Context)

Create godoc @summary Create a task group. @description Create a task group. @tags taskgroups @accept json @produce json @success 201 {object} api.TaskGroup @router /taskgroups [post] @param taskgroup body api.TaskGroup true "TaskGroup data"

func (TaskGroupHandler) Delete

func (h TaskGroupHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a task group. @description Delete a task group. @tags taskgroups @success 204 @router /taskgroups/{id} [delete] @param id path int true "TaskGroup ID"

func (TaskGroupHandler) Get

func (h TaskGroupHandler) Get(ctx *gin.Context)

Get godoc @summary Get a task group by ID. @description Get a task group by ID. @tags taskgroups @produce json @success 200 {object} api.TaskGroup @router /taskgroups/{id} [get] @param id path int true "TaskGroup ID"

func (TaskGroupHandler) List

func (h TaskGroupHandler) List(ctx *gin.Context)

List godoc @summary List all task groups. @description List all task groups. @tags taskgroups @produce json @success 200 {object} []api.TaskGroup @router /taskgroups [get]

func (TaskGroupHandler) Submit

func (h TaskGroupHandler) Submit(ctx *gin.Context)

Submit godoc @summary Submit a task group. @description Submit a task group. @tags taskgroups @accept json @success 204 @router /taskgroups/{id}/submit [put] @param id path int true "TaskGroup ID" @param taskgroup body TaskGroup false "TaskGroup data (optional)"

func (TaskGroupHandler) Update

func (h TaskGroupHandler) Update(ctx *gin.Context)

Update godoc @summary Update a task group. @description Update a task group. @tags taskgroups @accept json @success 204 @router /taskgroups/{id} [put] @param id path int true "Task ID" @param task body TaskGroup true "Task data"

type TaskHandler

type TaskHandler struct {
	BucketOwner
}

TaskHandler handles task routes.

func (TaskHandler) AddRoutes

func (h TaskHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (TaskHandler) BucketDelete

func (h TaskHandler) BucketDelete(ctx *gin.Context)

BucketDelete godoc @summary Delete bucket content by ID and path. @description Delete bucket content by ID and path. @tags tasks @produce json @success 204 @router /tasks/{id}/bucket/{wildcard} [delete] @param id path int true "Task ID" @param wildcard path string true "Content path"

func (TaskHandler) BucketGet

func (h TaskHandler) BucketGet(ctx *gin.Context)

BucketGet godoc @summary Get bucket content by ID and path. @description Get bucket content by ID and path. @description Returns index.html for directories when Accept=text/html else a tarball. @description ?filter=glob supports directory content filtering. @tags tasks @produce octet-stream @success 200 @router /tasks/{id}/bucket/{wildcard} [get] @param id path int true "Task ID" @param wildcard path string true "Content path" @param filter query string false "Filter"

func (TaskHandler) BucketPut added in v0.1.0

func (h TaskHandler) BucketPut(ctx *gin.Context)

BucketPut godoc @summary Upload bucket content by ID and path. @description Upload bucket content by ID and path (handles both [post] and [put] requests). @tags tasks @produce json @success 204 @router /tasks/{id}/bucket/{wildcard} [post] @param id path int true "Task ID" @param wildcard path string true "Content path"

func (TaskHandler) Cancel

func (h TaskHandler) Cancel(ctx *gin.Context)

Cancel godoc @summary Cancel a task. @description Cancel a task. @tags tasks @success 204 @router /tasks/{id}/cancel [put] @param id path int true "Task ID"

func (TaskHandler) Create

func (h TaskHandler) Create(ctx *gin.Context)

Create godoc @summary Create a task. @description Create a task. @tags tasks @accept json @produce json @success 201 {object} api.Task @router /tasks [post] @param task body api.Task true "Task data"

func (TaskHandler) CreateReport

func (h TaskHandler) CreateReport(ctx *gin.Context)

CreateReport godoc @summary Create a task report. @description Update a task report. @tags tasks @accept json @produce json @success 201 {object} api.TaskReport @router /tasks/{id}/report [post] @param id path int true "Task ID" @param task body api.TaskReport true "TaskReport data"

func (TaskHandler) Delete

func (h TaskHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a task. @description Delete a task. @tags tasks @success 204 @router /tasks/{id} [delete] @param id path int true "Task ID"

func (TaskHandler) DeleteReport

func (h TaskHandler) DeleteReport(ctx *gin.Context)

DeleteReport godoc @summary Delete a task report. @description Delete a task report. @tags tasks @accept json @produce json @success 204 @router /tasks/{id}/report [delete] @param id path int true "Task ID"

func (TaskHandler) Get

func (h TaskHandler) Get(ctx *gin.Context)

Get godoc @summary Get a task by ID. @description Get a task by ID. @tags tasks @produce json @success 200 {object} api.Task @router /tasks/{id} [get] @param id path int true "Task ID"

func (TaskHandler) List

func (h TaskHandler) List(ctx *gin.Context)

List godoc @summary List all tasks. @description List all tasks. @tags tasks @produce json @success 200 {object} []api.Task @router /tasks [get]

func (TaskHandler) Submit

func (h TaskHandler) Submit(ctx *gin.Context)

Submit godoc @summary Submit a task. @description Submit a task. @tags tasks @accept json @success 204 @router /tasks/{id}/submit [put] @param id path int true "Task ID" @param task body Task false "Task data (optional)"

func (TaskHandler) Update

func (h TaskHandler) Update(ctx *gin.Context)

Update godoc @summary Update a task. @description Update a task. @tags tasks @accept json @success 204 @router /tasks/{id} [put] @param id path int true "Task ID" @param task body Task true "Task data"

func (TaskHandler) UpdateReport

func (h TaskHandler) UpdateReport(ctx *gin.Context)

UpdateReport godoc @summary Update a task report. @description Update a task report. @tags tasks @accept json @produce json @success 200 {object} api.TaskReport @router /tasks/{id}/report [put] @param id path int true "Task ID" @param task body api.TaskReport true "TaskReport data"

type TaskReport

type TaskReport struct {
	Resource  `yaml:",inline"`
	Status    string      `json:"status"`
	Errors    []TaskError `json:"errors,omitempty" yaml:",omitempty"`
	Total     int         `json:"total,omitempty" yaml:",omitempty"`
	Completed int         `json:"completed,omitempty" yaml:",omitempty"`
	Activity  []string    `json:"activity,omitempty" yaml:",omitempty"`
	Result    interface{} `json:"result,omitempty" yaml:",omitempty" swaggertype:"object"`
	TaskID    uint        `json:"task"`
}

TaskReport REST resource.

func (*TaskReport) Model

func (r *TaskReport) Model() (m *model.TaskReport)

Model builds a model.

func (*TaskReport) With

func (r *TaskReport) With(m *model.TaskReport)

With updates the resource with the model.

type TechDependency added in v0.2.0

type TechDependency struct {
	Resource `yaml:",inline"`
	Provider string   `json:"provider" yaml:",omitempty"`
	Name     string   `json:"name" binding:"required"`
	Version  string   `json:"version,omitempty" yaml:",omitempty"`
	Indirect bool     `json:"indirect,omitempty" yaml:",omitempty"`
	Labels   []string `json:"labels,omitempty" yaml:",omitempty"`
	SHA      string   `json:"sha,omitempty" yaml:",omitempty"`
}

TechDependency REST resource.

func (*TechDependency) Model added in v0.2.0

func (r *TechDependency) Model() (m *model.TechDependency)

Model builds a model.

func (*TechDependency) With added in v0.2.0

func (r *TechDependency) With(m *model.TechDependency)

With updates the resource with the model.

type Ticket

type Ticket struct {
	Resource    `yaml:",inline"`
	Kind        string    `json:"kind" binding:"required"`
	Reference   string    `json:"reference"`
	Link        string    `json:"link"`
	Parent      string    `json:"parent" binding:"required"`
	Error       bool      `json:"error"`
	Message     string    `json:"message"`
	Status      string    `json:"status"`
	LastUpdated time.Time `json:"lastUpdated" yaml:"lastUpdated"`
	Fields      Fields    `json:"fields"`
	Application Ref       `json:"application" binding:"required"`
	Tracker     Ref       `json:"tracker" binding:"required"`
}

Ticket API Resource

func (*Ticket) Model

func (r *Ticket) Model() (m *model.Ticket)

Model builds a model.

func (*Ticket) With

func (r *Ticket) With(m *model.Ticket)

With updates the resource with the model.

type TicketHandler

type TicketHandler struct {
	BaseHandler
}

TicketHandler handles ticket routes.

func (TicketHandler) AddRoutes

func (h TicketHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (TicketHandler) Create

func (h TicketHandler) Create(ctx *gin.Context)

Create godoc @summary Create a ticket. @description Create a ticket. @tags tickets @accept json @produce json @success 201 {object} api.Ticket @router /tickets [post] @param ticket body api.Ticket true "Ticket data"

func (TicketHandler) Delete

func (h TicketHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a ticket. @description Delete a ticket. @tags tickets @success 204 @router /tickets/{id} [delete] @param id path int true "Ticket id"

func (TicketHandler) Get

func (h TicketHandler) Get(ctx *gin.Context)

Get godoc @summary Get a ticket by ID. @description Get a ticket by ID. @tags tickets @produce json @success 200 {object} api.Ticket @router /tickets/{id} [get] @param id path int true "Ticket ID"

func (TicketHandler) List

func (h TicketHandler) List(ctx *gin.Context)

List godoc @summary List all tickets. @description List all tickets. @tags tickets @produce json @success 200 {object} []api.Ticket @router /tickets [get]

type Tracker

type Tracker struct {
	Resource    `yaml:",inline"`
	Name        string    `json:"name" binding:"required"`
	URL         string    `json:"url" binding:"required"`
	Kind        string    `json:"kind" binding:"required,oneof=jira-cloud jira-onprem"`
	Message     string    `json:"message"`
	Connected   bool      `json:"connected"`
	LastUpdated time.Time `json:"lastUpdated" yaml:"lastUpdated"`
	Identity    Ref       `json:"identity" binding:"required"`
	Insecure    bool      `json:"insecure"`
}

Tracker API Resource

func (*Tracker) Model

func (r *Tracker) Model() (m *model.Tracker)

Model builds a model.

func (*Tracker) With

func (r *Tracker) With(m *model.Tracker)

With updates the resource with the model.

type TrackerError added in v0.2.0

type TrackerError struct {
	Reason string
}

TrackerError reports an error stemming from the Hub being unable to communicate with an external issue tracker.

func (*TrackerError) Error added in v0.2.0

func (r *TrackerError) Error() string

func (*TrackerError) Is added in v0.2.0

func (r *TrackerError) Is(err error) (matched bool)

type TrackerHandler

type TrackerHandler struct {
	BaseHandler
}

TrackerHandler handles ticket tracker routes.

func (TrackerHandler) AddRoutes

func (h TrackerHandler) AddRoutes(e *gin.Engine)

AddRoutes adds routes.

func (TrackerHandler) Create

func (h TrackerHandler) Create(ctx *gin.Context)

Create godoc @summary Create a tracker. @description Create a tracker. @tags trackers @accept json @produce json @success 201 {object} api.Tracker @router /trackers [post] @param tracker body api.Tracker true "Tracker data"

func (TrackerHandler) Delete

func (h TrackerHandler) Delete(ctx *gin.Context)

Delete godoc @summary Delete a tracker. @description Delete a tracker. @tags trackers @success 204 @router /trackers/{id} [delete] @param id path int true "Tracker id"

func (TrackerHandler) Get

func (h TrackerHandler) Get(ctx *gin.Context)

Get godoc @summary Get a tracker by ID. @description Get a tracker by ID. @tags trackers @produce json @success 200 {object} api.Tracker @router /trackers/{id} [get] @param id path int true "Tracker ID"

func (TrackerHandler) List

func (h TrackerHandler) List(ctx *gin.Context)

List godoc @summary List all trackers. @description List all trackers. @tags trackers @produce json @success 200 {object} []api.Tracker @router /trackers [get]

func (TrackerHandler) ProjectGet added in v0.2.0

func (h TrackerHandler) ProjectGet(ctx *gin.Context)

ProjectGet godoc @summary Get a tracker project by ID. @description Get a tracker project by ID. @tags trackers @produce json @success 200 {object} api.Project @router /trackers/{id}/projects/{id2} [get] @param id path int true "Tracker ID" @param id2 path string true "Project ID"

func (TrackerHandler) ProjectIssueTypeList added in v0.2.0

func (h TrackerHandler) ProjectIssueTypeList(ctx *gin.Context)

ProjectIssueTypeList godoc @summary List a tracker project's issue types. @description List a tracker project's issue types. @tags trackers @produce json @success 200 {object} []api.IssueType @router /trackers/{id}/projects/{id2}/issuetypes [get] @param id path int true "Tracker ID" @param id2 path string true "Project ID"

func (TrackerHandler) ProjectList added in v0.2.0

func (h TrackerHandler) ProjectList(ctx *gin.Context)

ProjectList godoc @summary List a tracker's projects. @description List a tracker's projects. @tags trackers @produce json @success 200 {object} []api.Project @router /trackers/{id}/projects [get] @param id path int true "Tracker ID"

func (TrackerHandler) Update

func (h TrackerHandler) Update(ctx *gin.Context)

Update godoc @summary Update a tracker. @description Update a tracker. @tags trackers @accept json @success 204 @router /trackers/{id} [put] @param id path int true "Tracker id" @param application body api.Tracker true "Tracker data"

type Vertex

type Vertex struct {
	ID             uint   `json:"applicationId" yaml:"applicationId"`
	Name           string `json:"applicationName" yaml:"applicationName"`
	Decision       string `json:"decision"`
	EffortEstimate string `json:"effortEstimate" yaml:"effortEstimate"`
	Effort         int    `json:"effort"`
	PositionY      int    `json:"positionY" yaml:"positionY"`
	PositionX      int    `json:"positionX" yaml:"positionX"`
}

Vertex represents a vertex in the dependency graph.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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