api

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 36 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 (
	ApplicationsRoot    = "/applications"
	ApplicationRoot     = ApplicationsRoot + "/:" + ID
	ApplicationTagsRoot = ApplicationRoot + "/tags"
	ApplicationTagRoot  = ApplicationTagsRoot + "/:" + ID2
	AppBucketRoot       = ApplicationRoot + "/bucket/*" + Wildcard
)

Routes

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

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

Routes

View Source
const (
	ID       = "id"
	ID2      = "id2"
	Key      = "key"
	Name     = "name"
	Wildcard = "wildcard"
	File     = "file"
)

Params

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

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 (
	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 (
	TagTypesRoot = "/tagtypes"
	TagTypeRoot  = TagTypesRoot + "/:" + ID
)

Routes

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

Routes

View Source
const (
	TaskGroupsRoot      = "/taskgroups"
	TaskGroupRoot       = TaskGroupsRoot + "/:" + ID
	TaskGroupBucketRoot = TaskGroupRoot + "/bucket/*" + 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 (
	TrackerId = "tracker"
)

Params.

Variables

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

Functions

This section is empty.

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 get @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 get @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 post @produce json @success 200 {object} api.DependencyGraph @router /adoptionplans [post] @param requestedApps path array true "requested App IDs"

type Application

type Application struct {
	Resource
	Name            string      `json:"name" binding:"required"`
	Description     string      `json:"description"`
	Bucket          string      `json:"bucket"`
	Repository      *Repository `json:"repository"`
	Binary          string      `json:"binary"`
	Facts           Facts       `json:"facts"`
	Review          *Ref        `json:"review"`
	Comments        string      `json:"comments"`
	Identities      []Ref       `json:"identities"`
	Tags            []Ref       `json:"tags"`
	BusinessService *Ref        `json:"businessService"`
}

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)

With updates the resource using the model.

type ApplicationHandler

type ApplicationHandler struct {
	BaseHandler
	BucketHandler
}

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 delete @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. @tags get @produce octet-stream @success 200 @router /applications/{id}/tasks/{id}/content/{wildcard} [get] @param id path string true "Task ID"

func (ApplicationHandler) BucketUpload

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

BucketUpload godoc @summary Upload bucket content by ID and path. @description Upload bucket content by ID and path (handles both [post] and [put] requests). @tags post @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 create @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 delete @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 delete @success 204 @router /applications [delete] @param application body []uint true "List of id"

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 get @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 list @produce json @success 200 {object} []api.Application @router /applications [get]

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 create @accept json @produce json @success 201 {object} api.Ref @router /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 delete @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 get @produce json @success 200 {object} []api.Ref @router /applications/{id}/tags/id [get] @param id path string true "Application ID"

func (ApplicationHandler) Update

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

Update godoc @summary Update an application. @description Update an application. @tags update @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 post @produce json @success 201 {string} token @router /auth/login [post]

type BaseHandler

type BaseHandler struct {
	// DB
	DB *gorm.DB
	// k8s Client
	Client client.Client
}

BaseHandler base handler.

func (*BaseHandler) CurrentUser

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

CurrentUser gets username from Keycloak auth token.

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

func (h *BaseHandler) With(db *gorm.DB, client client.Client)

With database and k8s client.

type BucketHandler

type BucketHandler struct {
}

BucketHandler provides bucket management.

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 create @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 delete @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 get @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 list @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 update @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 delete @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 get @produce json @success 200 {object} api.Cache @router /caches/{id} [get] @param name path string true "Cache DIR"

type CopyRequest

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

CopyRequest 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 create @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 delete @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 get @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 list @produce json @success 200 {object} []api.Dependency @router /dependencies [get]

type Facts

type Facts map[string]interface{}

Facts about the application.

type Fields

type Fields map[string]interface{}

type Handler

type Handler interface {
	With(*gorm.DB, client.Client)
	AddRoutes(e *gin.Engine)
}

Handler.

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 create @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 delete @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 get @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 get @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 update @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 delete @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 delete @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 export @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 get @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 get @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 list @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 list @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 post @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 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 create @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 delete @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 get @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 get @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 update @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"`
}

Login REST resource.

type Metadata

type Metadata map[string]interface{}

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 create @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 delete @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 get @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 get @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 update @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"`
	CreateUser string    `json:"createUser"`
	UpdateUser string    `json:"updateUser"`
	CreateTime time.Time `json:"createTime"`
}

REST resource.

func (*Resource) With

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

With updates the resource with the model.

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 copy @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 create @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 delete @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 get @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 get @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 update @accept json @success 204 @router /reviews/{id} [put] @param id path string true "Review ID" @param review body api.Review true "Review 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 get @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 create, setting @accept json @produce json @success 201 {object} api.Setting @router /settings [post] @param setting body api.Setting true "Setting data"

func (SettingHandler) Delete

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

Delete godoc @summary Delete a setting. @description Delete a setting. @tags delete, setting @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 get, setting @produce json @success 200 {object} interface{} @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 list, setting @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 update, setting @accept json @produce json @success 204 @router /settings/{key} [put] @param key path string true "Key"

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"`
}

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"`
}

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 create @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 delete @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 get @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 get @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 update @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 create @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 delete @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 get @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 get @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 update @accept json @success 204 @router /stakeholders/{id} [put] @param id path string true "Stakeholder ID" @param stakeholder body api.Stakeholder true "Stakeholder data"

type TTL

type TTL model.TTL

TTL

type Tag

type Tag struct {
	Resource
	Name    string `json:"name" binding:"required"`
	TagType Ref    `json:"tagType" 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 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 create @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 delete @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 get @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 get @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 update @accept json @success 204 @router /tags/{id} [put] @param id path string true "Tag ID" @param tag body api.Tag true "Tag data"

type TagType

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

TagType REST resource.

func (*TagType) Model

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

Model builds a model.

func (*TagType) With

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

With updates the resource with the model.

type TagTypeHandler

type TagTypeHandler struct {
	BaseHandler
}

TagTypeHandler handles the tag-type route.

func (TagTypeHandler) AddRoutes

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

AddRoutes adds routes.

func (TagTypeHandler) Create

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

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

func (TagTypeHandler) Delete

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

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

func (TagTypeHandler) Get

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

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

func (TagTypeHandler) List

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

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

func (TagTypeHandler) Update

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

Update godoc @summary Update a tag type. @description Update a tag type. @tags update @accept json @success 204 @router /tagtypes/{id} [put] @param id path string true "Tag Type ID" @param tag_type body api.TagType true "Tag Type data"

type Task

type Task struct {
	Resource
	Name        string      `json:"name"`
	Locator     string      `json:"locator,omitempty"`
	Priority    int         `json:"priority,omitempty"`
	Variant     string      `json:"variant,omitempty"`
	Policy      string      `json:"policy,omitempty"`
	TTL         *TTL        `json:"ttl,omitempty"`
	Addon       string      `json:"addon,omitempty" binding:"required"`
	Data        interface{} `json:"data" swaggertype:"object" binding:"required"`
	Application *Ref        `json:"application,omitempty"`
	State       string      `json:"state"`
	Image       string      `json:"image,omitempty"`
	Bucket      string      `json:"bucket,omitempty"`
	Purged      bool        `json:"purged,omitempty"`
	Started     *time.Time  `json:"started,omitempty"`
	Terminated  *time.Time  `json:"terminated,omitempty"`
	Error       string      `json:"error,omitempty"`
	Pod         string      `json:"pod,omitempty"`
	Retries     int         `json:"retries,omitempty"`
	Canceled    bool        `json:"canceled,omitempty"`
	Report      *TaskReport `json:"report,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 string      `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 {
	BaseHandler
	BucketHandler
}

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 delete @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. @tags get @produce octet-stream @success 200 @router /taskgroups/{id}/bucket/{wildcard} [get] @param id path string true "TaskGroup ID"

func (TaskGroupHandler) BucketUpload

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

BucketUpload godoc @summary Upload bucket content by ID and path. @description Upload bucket content by ID and path (handles both [post] and [put] requests). @tags post @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 create @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 delete @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 get @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 get @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 update @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 update @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 {
	BaseHandler
	BucketHandler
}

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 delete @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. @tags get @produce octet-stream @success 200 @router /tasks/{id}/bucket/{wildcard} [get] @param id path string true "Task ID"

func (TaskHandler) BucketUpload

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

BucketUpload godoc @summary Upload bucket content by ID and path. @description Upload bucket content by ID and path (handles both [post] and [put] requests). @tags post @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 delete @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 create @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 update @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 delete @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 update @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 get @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 get @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 update @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 update @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 update @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
	Status    string      `json:"status"`
	Error     string      `json:"error"`
	Total     int         `json:"total"`
	Completed int         `json:"completed"`
	Activity  []string    `json:"activity"`
	Result    interface{} `json:"result,omitempty"`
	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 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 create @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 delete @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 get @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 get @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"`
}

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 create @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 delete @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 get @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 get @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 update @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.

Jump to

Keyboard shortcuts

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