api

package
v0.2.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 41 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"
	AnalysesCompositeRoot      = AnalysesRoot + "/composite"
	AnalysisCompositeDepRoot   = AnalysesCompositeRoot + "/dependencies"
	AnalysisCompositeIssueRoot = AnalysesCompositeRoot + "/issues"

	AppAnalysesRoot       = ApplicationRoot + "/analyses"
	AppAnalysisRoot       = ApplicationRoot + "/analysis"
	AppAnalysisDepsRoot   = AppAnalysisRoot + "/dependencies"
	AppAnalysisIssuesRoot = AppAnalysisRoot + "/issues"
)

Routes

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

Routes

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

Routes

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 (
	PathfinderRoot   = "/pathfinder"
	AssessmentsRoot  = "assessments"
	AssessmentsRootX = AssessmentsRoot + "/*" + Wildcard
)

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 (
	DirectoryArchive = "archive"
	DirectoryExpand  = "expand"
)

Header Values

View Source
const (
	ProxiesRoot = "/proxies"
	ProxyRoot   = ProxiesRoot + "/:" + 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 (
	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
)

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 (
	MIMEOCTETSTREAM = "application/octet-stream"
)

MIME Types.

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 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)

Get 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.DependencyGraph @router /adoptionplans [post] @param requestedApps path array true "requested App IDs"

type Analysis added in v0.2.0

type Analysis struct {
	Resource     `yaml:",inline"`
	Issues       []Issue          `json:"issues"`
	Dependencies []TechDependency `json:"dependencies"`
}

Analysis (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. @tags analyses @accept json @produce json @success 201 {object} api.Analysis @router /application/{id}/analyses [post] @param task body api.Analysis true "Analysis data"

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 - id @description - name @description - version @description - type @description - sha @description - indirect @tags dependencies @produce json @success 200 {object} []api.TechDependency @router /application/{id}/analysis/dependencies [get] @param id path string 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 - id @description - ruleid @description - name @description - category @description - effort @tags issues @produce json @success 200 {object} []api.Issue @router /application/{id}/analysis/issues [get] @param id path string 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 json @success 200 {object} api.Analysis @router /applications/{id}/analysis [get] @param id path string 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 string true "Analysis ID"

func (AnalysisHandler) DepComposites

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

DepComposites godoc @summary List dependency composites. @description List dependency composites. @description filters: @description - name @description - version @description - sha @description - indirect @description - labels @description - application.(id|name) @description - tag.id @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|name) @description - tag.id @tags dependencies @produce json @success 200 {object} []api.TechDependency @router /analyses/dependencies [get]

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 json @success 200 {object} api.Analysis @router /analyses/{id} [get] @param id path string true "Analysis ID"

func (AnalysisHandler) IssueComposites

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

IssueComposites godoc @summary List issue composites. @description List issue composites. @description filters: @description - ruleset @description - rule @description - category @description - effort @description - labels @description - application.(id|name) @description - tag.id @tags issuecomposites @produce json @success 200 {object} []api.IssueComposite @router /analyses/issues [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 - id @description - ruleset @description - rule @description - name @description - category @description - effort @description - labels @description - application.(id|name) @description - tag.id @tags issues @produce json @success 200 {object} []api.Issue @router /analyses/issues [get]

type AnalysisLink struct {
	URL   string `json:"url"`
	Title string `json:"title,omitempty" yaml:",omitempty"`
}

AnalysisLink analysis report link.

type Application

type Application struct {
	Resource
	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"`
	Owner           *Ref        `json:"owner"`
	Contributors    []Ref       `json:"contributors"`
	MigrationWave   *Ref        `json:"migrationWave"`
}

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.

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) 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 string true "Application ID"

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 string true "Application ID" @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 string true "Application ID"

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 string 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. @tags applications @success 204 @router /applications/{id}/facts/{key}/{source} [delete] @param id path string true "Application ID" @param key path string true "Fact key" @param source path string true "Fact source"

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. @tags applications @produce json @success 200 {object} api.Fact @router /applications/{id}/facts/{name}/{source} [get] @param id path string true "Application ID" @param key path string true "Fact key" @param source path string true "Fact source"

func (ApplicationHandler) FactList added in v0.1.0

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

FactList godoc @summary List facts. @description List facts. Can be filtered by source. @description By default facts from all sources are returned. @tags applications @produce json @success 200 {object} []api.Fact @router /applications/{id}/facts [get] @param id path string true "Application ID" @param source query string false "Fact source"

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. @tags applications @accept json @produce json @success 204 @router /applications/{id}/facts/{key} [put] @param id path string true "Application ID" @param key path string true "Fact key" @param source path string true "Fact source" @param fact body api.Fact true "Fact data"

func (ApplicationHandler) FactReplace added in v0.2.0

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

FactReplace godoc @summary Replace all facts from a source. @description Replace all facts from a source. @tags applications @success 204 @router /applications/{id}/facts [put] @param id path string true "Application ID" @param source query string true "Source"

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"

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 string 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/id [get] @param id path string 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 string 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 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) 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) 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) HasScope

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

HasScope determines if the token has the specified scope.

func (*BaseHandler) Paginated

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

Paginated returns a paginated AND sorted DB client.

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) Sorted

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

Sorted returns a sorted DB client.

func (*BaseHandler) Status added in v0.2.0

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

Status sets the status code.

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
	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 string true "Bucket ID"

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 string true "Task ID" @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 string true "Bucket ID"

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 string 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 string 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
	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 string 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 string 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 string 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/{id} [get] @param name 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 DepComposite

type DepComposite struct {
	Name     string   `json:"name"`
	Version  string   `json:"version"`
	SHA      string   `json:"sha"`
	Labels   []string `json:"labels"`
	Affected int      `json:"affected"`
}

DepComposite composite REST resource.

type Dependency

type Dependency struct {
	Resource
	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 string 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 string 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 DirFilter added in v0.1.0

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

DirFilter supports glob-style filtering.

func (*DirFilter) Match added in v0.1.0

func (r *DirFilter) Match(path string) (b bool)

Match determines if path matches the filter.

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 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
	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 string 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 string 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 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
	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 string 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 string 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 string 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 string 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 string 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 string 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 string 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
	Filename       string    `json:"filename"`
	ImportStatus   string    `json:"importStatus"`
	ImportTime     time.Time `json:"importTime"`
	ValidCount     int       `json:"validCount"`
	InvalidCount   int       `json:"invalidCount"`
	CreateEntities bool      `json:"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"`
	URI      string  `json:"uri"`
	Message  string  `json:"message"`
	CodeSnip string  `json:"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       []AnalysisLink `json:"links,omitempty" yaml:",omitempty"`
	Facts       FactMap        `json:"facts,omitempty" yaml:",omitempty"`
	Labels      []string       `json:"labels"`
	Application uint           `json:"application" binding:"-"`
}

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 IssueComposite

type IssueComposite 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"`
	Affected    int      `json:"affected"`
}

IssueComposite composite REST resource.

func (*IssueComposite) RuleId

func (r *IssueComposite) RuleId() (id string)

RuleId returns unique rule ID.

type JobFunction

type JobFunction struct {
	Resource
	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 string 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 string 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 string true "Job Function ID" @param job_function body api.JobFunction true "Job Function data"

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 Metadata

type Metadata map[string]interface{}

type MigrationWave added in v0.1.0

type MigrationWave struct {
	Resource
	Name              string    `json:"name"`
	StartDate         time.Time `json:"startDate"`
	EndDate           time.Time `json:"endDate"`
	Applications      []Ref     `json:"applications"`
	Stakeholders      []Ref     `json:"stakeholders"`
	StakeholderGroups []Ref     `json:"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 Pathfinder

type Pathfinder struct {
}

Pathfinder client.

func (*Pathfinder) DeleteAssessment

func (r *Pathfinder) DeleteAssessment(ids []uint, ctx *gin.Context) (err error)

DeleteAssessment deletes associated assessments by application Ids.

type PathfinderHandler

type PathfinderHandler struct {
	BaseHandler
}

PathfinderHandler handles assessment routes.

func (PathfinderHandler) AddRoutes

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

AddRoutes adds routes.

func (PathfinderHandler) ReverseProxy

func (h PathfinderHandler) ReverseProxy(ctx *gin.Context)

Get godoc @summary ReverseProxy - forward to pathfinder. @description ReverseProxy forwards API calls to pathfinder API.

type Proxy

type Proxy struct {
	Resource
	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 string 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 string 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 string true "Proxy ID" @param proxy body Proxy true "Proxy data"

type Ref

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

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

func (*Ref) With

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

With id and named model.

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:",omitempty"`
	CreateUser string    `json:"createUser" yaml:",omitempty"`
	UpdateUser string    `json:"updateUser" yaml:",omitempty"`
	CreateTime time.Time `json:"createTime" yaml:",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
	BusinessCriticality uint   `json:"businessCriticality"`
	EffortEstimate      string `json:"effortEstimate"`
	ProposedAction      string `json:"proposedAction"`
	WorkPriority        uint   `json:"workPriority"`
	Comments            string `json:"comments"`
	Application         Ref    `json:"application" binding:"required"`
}

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 string 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 string 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 string true "Review ID" @param review body api.Review true "Review data"

type Rule added in v0.2.0

type Rule struct {
	Resource
	Name        string      `json:"name,omitempty"`
	Description string      `json:"description,omitempty"`
	Labels      interface{} `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 RuleSet added in v0.1.0

type RuleSet struct {
	Resource
	Kind        string      `json:"kind,omitempty"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Image       Ref         `json:"image"`
	Rules       []Rule      `json:"rules"`
	Custom      bool        `json:"custom,omitempty"`
	Repository  *Repository `json:"repository,omitempty"`
	Identity    *Ref        `json:"identity,omitempty"`
}

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 string 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 string 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. @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 string 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 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 struct {
	Descending bool
	Field      string
}

Sort provides sorting.

func (*Sort) Sorted

func (p *Sort) Sorted(in *gorm.DB) (out *gorm.DB)

Sorted returns sorted DB.

func (*Sort) With

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

With context.

type Stakeholder

type Stakeholder struct {
	Resource
	Name             string `json:"name" binding:"required"`
	Email            string `json:"email" binding:"required"`
	Groups           []Ref  `json:"stakeholderGroups"`
	BusinessServices []Ref  `json:"businessServices"`
	JobFunction      *Ref   `json:"jobFunction"`
	Owns             []Ref  `json:"owns"`
	Contributes      []Ref  `json:"contributes"`
	MigrationWaves   []Ref  `json:"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
	Name           string `json:"name" binding:"required"`
	Description    string `json:"description"`
	Stakeholders   []Ref  `json:"stakeholders"`
	MigrationWaves []Ref  `json:"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 string 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 string 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 string 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 string 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 string 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 string 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
	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
	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 string 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 string 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 string 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 string 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 string 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 string 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 string 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"`
}

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)

With id and named model.

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"`
	Bucket      *Ref        `json:"bucket,omitempty" yaml:",omitempty"`
	Purged      bool        `json:"purged,omitempty" yaml:",omitempty"`
	Started     *time.Time  `json:"started,omitempty" yaml:",omitempty"`
	Terminated  *time.Time  `json:"terminated,omitempty" yaml:",omitempty"`
	Error       string      `json:"error,omitempty" yaml:",omitempty"`
	Pod         string      `json:"pod,omitempty" yaml:",omitempty"`
	Retries     int         `json:"retries,omitempty" yaml:",omitempty"`
	Canceled    bool        `json:"canceled,omitempty" yaml:",omitempty"`
	Report      *TaskReport `json:"report,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 TaskGroup

type TaskGroup struct {
	Resource
	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 string true "Task ID"

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 string true "TaskGroup ID" @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 string true "TaskGroup ID"

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 string 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 string 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 string 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 string 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 string true "Task ID"

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 string true "Task ID" @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 string true "Task ID"

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 string 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 string 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 string 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 string 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 string 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 string 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 string 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 string true "Task ID" @param task body api.TaskReport true "TaskReport data"

type TaskReport

type TaskReport struct {
	Resource  `yaml:",inline"`
	Status    string      `json:"status"`
	Error     string      `json:"error,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"`
	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
	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"`
	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 string 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
	Name        string    `json:"name" binding:"required"`
	URL         string    `json:"url" binding:"required"`
	Kind        string    `json:"kind" binding:"required,oneof=jira-cloud jira-server jira-datacenter"`
	Message     string    `json:"message"`
	Connected   bool      `json:"connected"`
	LastUpdated time.Time `json:"lastUpdated"`
	Metadata    Metadata  `json:"metadata"`
	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 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 string 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) 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"`
	Name           string `json:"applicationName"`
	Decision       string `json:"decision"`
	EffortEstimate string `json:"effortEstimate"`
	Effort         int    `json:"effort"`
	PositionY      int    `json:"positionY"`
	PositionX      int    `json:"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