id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
listlengths
21
1.41k
docstring
stringlengths
6
2.61k
docstring_tokens
listlengths
3
215
sha
stringlengths
40
40
url
stringlengths
85
252
135,400
fabric8-services/fabric8-wit
controller/workitems.go
NewNotifyingWorkitemsController
func NewNotifyingWorkitemsController(service *goa.Service, db application.DB, notificationChannel notification.Channel, config WorkItemControllerConfig) *WorkitemsController { n := notificationChannel if n == nil { n = &notification.DevNullChannel{} } return &WorkitemsController{ Controller: service.NewContro...
go
func NewNotifyingWorkitemsController(service *goa.Service, db application.DB, notificationChannel notification.Channel, config WorkItemControllerConfig) *WorkitemsController { n := notificationChannel if n == nil { n = &notification.DevNullChannel{} } return &WorkitemsController{ Controller: service.NewContro...
[ "func", "NewNotifyingWorkitemsController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "notificationChannel", "notification", ".", "Channel", ",", "config", "WorkItemControllerConfig", ")", "*", "WorkitemsController", "{", "...
// NewNotifyingWorkitemsController creates a workitem controller with notification broadcast.
[ "NewNotifyingWorkitemsController", "creates", "a", "workitem", "controller", "with", "notification", "broadcast", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/workitems.go#L40-L50
135,401
fabric8-services/fabric8-wit
controller/deployments.go
NewDeploymentsController
func NewDeploymentsController(service *goa.Service, config *configuration.Registry) *DeploymentsController { return &DeploymentsController{ Controller: service.NewController("DeploymentsController"), Config: config, ClientGetter: &defaultClientGetter{ config: config, }, } }
go
func NewDeploymentsController(service *goa.Service, config *configuration.Registry) *DeploymentsController { return &DeploymentsController{ Controller: service.NewController("DeploymentsController"), Config: config, ClientGetter: &defaultClientGetter{ config: config, }, } }
[ "func", "NewDeploymentsController", "(", "service", "*", "goa", ".", "Service", ",", "config", "*", "configuration", ".", "Registry", ")", "*", "DeploymentsController", "{", "return", "&", "DeploymentsController", "{", "Controller", ":", "service", ".", "NewContro...
// NewDeploymentsController creates a deployments controller.
[ "NewDeploymentsController", "creates", "a", "deployments", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L46-L54
135,402
fabric8-services/fabric8-wit
controller/deployments.go
GetKubeClient
func (g *defaultClientGetter) GetKubeClient(ctx context.Context) (kubernetes.KubeClientInterface, error) { kubeNamespaceName, err := g.getNamespaceName(ctx) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "could not retrieve namespace name") return nil, errs.Wrap(err, "could not retrie...
go
func (g *defaultClientGetter) GetKubeClient(ctx context.Context) (kubernetes.KubeClientInterface, error) { kubeNamespaceName, err := g.getNamespaceName(ctx) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "could not retrieve namespace name") return nil, errs.Wrap(err, "could not retrie...
[ "func", "(", "g", "*", "defaultClientGetter", ")", "GetKubeClient", "(", "ctx", "context", ".", "Context", ")", "(", "kubernetes", ".", "KubeClientInterface", ",", "error", ")", "{", "kubeNamespaceName", ",", "err", ":=", "g", ".", "getNamespaceName", "(", "...
// GetKubeClient creates a kube client for the appropriate cluster assigned to the current user
[ "GetKubeClient", "creates", "a", "kube", "client", "for", "the", "appropriate", "cluster", "assigned", "to", "the", "current", "user" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L138-L184
135,403
fabric8-services/fabric8-wit
controller/deployments.go
SetDeployment
func (c *DeploymentsController) SetDeployment(ctx *app.SetDeploymentDeploymentsContext) error { // we double check podcount here, because in the future we might have different query parameters // (for setting different Pod switches) and PodCount might become optional if ctx.PodCount == nil { return errors.NewBadP...
go
func (c *DeploymentsController) SetDeployment(ctx *app.SetDeploymentDeploymentsContext) error { // we double check podcount here, because in the future we might have different query parameters // (for setting different Pod switches) and PodCount might become optional if ctx.PodCount == nil { return errors.NewBadP...
[ "func", "(", "c", "*", "DeploymentsController", ")", "SetDeployment", "(", "ctx", "*", "app", ".", "SetDeploymentDeploymentsContext", ")", "error", "{", "// we double check podcount here, because in the future we might have different query parameters", "// (for setting different Po...
// SetDeployment runs the setDeployment action.
[ "SetDeployment", "runs", "the", "setDeployment", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L187-L212
135,404
fabric8-services/fabric8-wit
controller/deployments.go
DeleteDeployment
func (c *DeploymentsController) DeleteDeployment(ctx *app.DeleteDeploymentDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID) if err != nil { return jsonapi...
go
func (c *DeploymentsController) DeleteDeployment(ctx *app.DeleteDeploymentDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID) if err != nil { return jsonapi...
[ "func", "(", "c", "*", "DeploymentsController", ")", "DeleteDeployment", "(", "ctx", "*", "app", ".", "DeleteDeploymentDeploymentsContext", ")", "error", "{", "kc", ",", "err", ":=", "c", ".", "GetKubeClient", "(", "ctx", ")", "\n", "defer", "cleanup", "(", ...
// DeleteDeployment runs the deleteDeployment action.
[ "DeleteDeployment", "runs", "the", "deleteDeployment", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L215-L237
135,405
fabric8-services/fabric8-wit
controller/deployments.go
ShowDeploymentStatSeries
func (c *DeploymentsController) ShowDeploymentStatSeries(ctx *app.ShowDeploymentStatSeriesDeploymentsContext) error { endTime := time.Now() startTime := endTime.Add(-8 * time.Hour) // default: start time is 8 hours before end time limit := -1 // default: No limit if ctx.Limit != nil {...
go
func (c *DeploymentsController) ShowDeploymentStatSeries(ctx *app.ShowDeploymentStatSeriesDeploymentsContext) error { endTime := time.Now() startTime := endTime.Add(-8 * time.Hour) // default: start time is 8 hours before end time limit := -1 // default: No limit if ctx.Limit != nil {...
[ "func", "(", "c", "*", "DeploymentsController", ")", "ShowDeploymentStatSeries", "(", "ctx", "*", "app", ".", "ShowDeploymentStatSeriesDeploymentsContext", ")", "error", "{", "endTime", ":=", "time", ".", "Now", "(", ")", "\n", "startTime", ":=", "endTime", ".",...
// ShowDeploymentStatSeries runs the showDeploymentStatSeries action.
[ "ShowDeploymentStatSeries", "runs", "the", "showDeploymentStatSeries", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L240-L286
135,406
fabric8-services/fabric8-wit
controller/deployments.go
ShowDeploymentPodLimitRange
func (c *DeploymentsController) ShowDeploymentPodLimitRange(ctx *app.ShowDeploymentPodLimitRangeDeploymentsContext) error { // Inputs : spaceId, appName, deployName kc, err := c.GetKubeClient(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } spaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.Sp...
go
func (c *DeploymentsController) ShowDeploymentPodLimitRange(ctx *app.ShowDeploymentPodLimitRangeDeploymentsContext) error { // Inputs : spaceId, appName, deployName kc, err := c.GetKubeClient(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } spaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.Sp...
[ "func", "(", "c", "*", "DeploymentsController", ")", "ShowDeploymentPodLimitRange", "(", "ctx", "*", "app", ".", "ShowDeploymentPodLimitRangeDeploymentsContext", ")", "error", "{", "// Inputs : spaceId, appName, deployName", "kc", ",", "err", ":=", "c", ".", "GetKubeCli...
// ShowDeploymentPodLimitRange runs the showDeploymentPodLimitRange action.
[ "ShowDeploymentPodLimitRange", "runs", "the", "showDeploymentPodLimitRange", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L289-L311
135,407
fabric8-services/fabric8-wit
controller/deployments.go
ShowDeploymentStats
func (c *DeploymentsController) ShowDeploymentStats(ctx *app.ShowDeploymentStatsDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID) if err != nil { return ...
go
func (c *DeploymentsController) ShowDeploymentStats(ctx *app.ShowDeploymentStatsDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID) if err != nil { return ...
[ "func", "(", "c", "*", "DeploymentsController", ")", "ShowDeploymentStats", "(", "ctx", "*", "app", ".", "ShowDeploymentStatsDeploymentsContext", ")", "error", "{", "kc", ",", "err", ":=", "c", ".", "GetKubeClient", "(", "ctx", ")", "\n", "defer", "cleanup", ...
// ShowDeploymentStats runs the showDeploymentStats action.
[ "ShowDeploymentStats", "runs", "the", "showDeploymentStats", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L318-L355
135,408
fabric8-services/fabric8-wit
controller/deployments.go
ShowSpace
func (c *DeploymentsController) ShowSpace(ctx *app.ShowSpaceDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID) if err != nil || kubeSpaceName == nil { ret...
go
func (c *DeploymentsController) ShowSpace(ctx *app.ShowSpaceDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID) if err != nil || kubeSpaceName == nil { ret...
[ "func", "(", "c", "*", "DeploymentsController", ")", "ShowSpace", "(", "ctx", "*", "app", ".", "ShowSpaceDeploymentsContext", ")", "error", "{", "kc", ",", "err", ":=", "c", ".", "GetKubeClient", "(", "ctx", ")", "\n", "defer", "cleanup", "(", "kc", ")",...
// ShowSpace runs the showSpace action.
[ "ShowSpace", "runs", "the", "showSpace", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L358-L388
135,409
fabric8-services/fabric8-wit
controller/deployments.go
ShowSpaceEnvironments
func (c *DeploymentsController) ShowSpaceEnvironments(ctx *app.ShowSpaceEnvironmentsDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } envs, err := kc.GetEnvironments() if err != nil { return jsonapi.JSONErrorResponse(ct...
go
func (c *DeploymentsController) ShowSpaceEnvironments(ctx *app.ShowSpaceEnvironmentsDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } envs, err := kc.GetEnvironments() if err != nil { return jsonapi.JSONErrorResponse(ct...
[ "func", "(", "c", "*", "DeploymentsController", ")", "ShowSpaceEnvironments", "(", "ctx", "*", "app", ".", "ShowSpaceEnvironmentsDeploymentsContext", ")", "error", "{", "kc", ",", "err", ":=", "c", ".", "GetKubeClient", "(", "ctx", ")", "\n", "defer", "cleanup...
// ShowSpaceEnvironments runs the showSpaceEnvironments action. // FIXME Remove this method once showSpaceEnvironments API is removed.
[ "ShowSpaceEnvironments", "runs", "the", "showSpaceEnvironments", "action", ".", "FIXME", "Remove", "this", "method", "once", "showSpaceEnvironments", "API", "is", "removed", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L392-L413
135,410
fabric8-services/fabric8-wit
controller/deployments.go
ShowEnvironmentsBySpace
func (c *DeploymentsController) ShowEnvironmentsBySpace(ctx *app.ShowEnvironmentsBySpaceDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID) if err != nil || ...
go
func (c *DeploymentsController) ShowEnvironmentsBySpace(ctx *app.ShowEnvironmentsBySpaceDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID) if err != nil || ...
[ "func", "(", "c", "*", "DeploymentsController", ")", "ShowEnvironmentsBySpace", "(", "ctx", "*", "app", ".", "ShowEnvironmentsBySpaceDeploymentsContext", ")", "error", "{", "kc", ",", "err", ":=", "c", ".", "GetKubeClient", "(", "ctx", ")", "\n", "defer", "cle...
// ShowEnvironmentsBySpace runs the showEnvironmentsBySpace action.
[ "ShowEnvironmentsBySpace", "runs", "the", "showEnvironmentsBySpace", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L416-L441
135,411
fabric8-services/fabric8-wit
controller/deployments.go
ShowAllEnvironments
func (c *DeploymentsController) ShowAllEnvironments(ctx *app.ShowAllEnvironmentsDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } envs, err := kc.GetEnvironments() if err != nil { return jsonapi.JSONErrorResponse(ctx, er...
go
func (c *DeploymentsController) ShowAllEnvironments(ctx *app.ShowAllEnvironmentsDeploymentsContext) error { kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } envs, err := kc.GetEnvironments() if err != nil { return jsonapi.JSONErrorResponse(ctx, er...
[ "func", "(", "c", "*", "DeploymentsController", ")", "ShowAllEnvironments", "(", "ctx", "*", "app", ".", "ShowAllEnvironmentsDeploymentsContext", ")", "error", "{", "kc", ",", "err", ":=", "c", ".", "GetKubeClient", "(", "ctx", ")", "\n", "defer", "cleanup", ...
// ShowAllEnvironments runs the showAllEnvironments action.
[ "ShowAllEnvironments", "runs", "the", "showAllEnvironments", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L444-L464
135,412
fabric8-services/fabric8-wit
controller/deployments.go
WatchEnvironmentEvents
func (c *DeploymentsController) WatchEnvironmentEvents(ctx *app.WatchEnvironmentEventsDeploymentsContext) error { c.WatchEnvironmentEventsWSHandler(ctx).ServeHTTP(ctx.ResponseWriter, ctx.Request) return nil }
go
func (c *DeploymentsController) WatchEnvironmentEvents(ctx *app.WatchEnvironmentEventsDeploymentsContext) error { c.WatchEnvironmentEventsWSHandler(ctx).ServeHTTP(ctx.ResponseWriter, ctx.Request) return nil }
[ "func", "(", "c", "*", "DeploymentsController", ")", "WatchEnvironmentEvents", "(", "ctx", "*", "app", ".", "WatchEnvironmentEventsDeploymentsContext", ")", "error", "{", "c", ".", "WatchEnvironmentEventsWSHandler", "(", "ctx", ")", ".", "ServeHTTP", "(", "ctx", "...
// WatchEnvironmentEvents runs the watchEnvironmentEvents action.
[ "WatchEnvironmentEvents", "runs", "the", "watchEnvironmentEvents", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L467-L470
135,413
fabric8-services/fabric8-wit
controller/deployments.go
WatchEnvironmentEventsWSHandler
func (c *DeploymentsController) WatchEnvironmentEventsWSHandler(ctx *app.WatchEnvironmentEventsDeploymentsContext) websocket.Handler { return func(ws *websocket.Conn) { defer ws.Close() kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, ...
go
func (c *DeploymentsController) WatchEnvironmentEventsWSHandler(ctx *app.WatchEnvironmentEventsDeploymentsContext) websocket.Handler { return func(ws *websocket.Conn) { defer ws.Close() kc, err := c.GetKubeClient(ctx) defer cleanup(kc) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, ...
[ "func", "(", "c", "*", "DeploymentsController", ")", "WatchEnvironmentEventsWSHandler", "(", "ctx", "*", "app", ".", "WatchEnvironmentEventsDeploymentsContext", ")", "websocket", ".", "Handler", "{", "return", "func", "(", "ws", "*", "websocket", ".", "Conn", ")",...
// WatchEnvironmentEventsWSHandler establishes a websocket connection to run the watchEnvironmentEvents action.
[ "WatchEnvironmentEventsWSHandler", "establishes", "a", "websocket", "connection", "to", "run", "the", "watchEnvironmentEvents", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments.go#L473-L543
135,414
fabric8-services/fabric8-wit
space/authz/authz.go
NewAuthzService
func NewAuthzService(config auth.ServiceConfiguration) *AuthzRoleService { return &AuthzRoleService{Config: config, Doer: rest.DefaultHttpDoer()} }
go
func NewAuthzService(config auth.ServiceConfiguration) *AuthzRoleService { return &AuthzRoleService{Config: config, Doer: rest.DefaultHttpDoer()} }
[ "func", "NewAuthzService", "(", "config", "auth", ".", "ServiceConfiguration", ")", "*", "AuthzRoleService", "{", "return", "&", "AuthzRoleService", "{", "Config", ":", "config", ",", "Doer", ":", "rest", ".", "DefaultHttpDoer", "(", ")", "}", "\n", "}" ]
// NewAuthzService constructs a new AuthzRoleService
[ "NewAuthzService", "constructs", "a", "new", "AuthzRoleService" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/space/authz/authz.go#L55-L57
135,415
fabric8-services/fabric8-wit
space/authz/authz.go
Authorize
func (s *AuthzRoleService) Authorize(ctx context.Context, spaceID string) (bool, error) { jwttoken := goajwt.ContextJWT(ctx) if jwttoken == nil { return false, errors.NewUnauthorizedError("missing token") } return s.checkRole(ctx, *jwttoken, spaceID) }
go
func (s *AuthzRoleService) Authorize(ctx context.Context, spaceID string) (bool, error) { jwttoken := goajwt.ContextJWT(ctx) if jwttoken == nil { return false, errors.NewUnauthorizedError("missing token") } return s.checkRole(ctx, *jwttoken, spaceID) }
[ "func", "(", "s", "*", "AuthzRoleService", ")", "Authorize", "(", "ctx", "context", ".", "Context", ",", "spaceID", "string", ")", "(", "bool", ",", "error", ")", "{", "jwttoken", ":=", "goajwt", ".", "ContextJWT", "(", "ctx", ")", "\n", "if", "jwttoke...
// Authorize returns true if the current user is among the space collaborators
[ "Authorize", "returns", "true", "if", "the", "current", "user", "is", "among", "the", "space", "collaborators" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/space/authz/authz.go#L60-L66
135,416
fabric8-services/fabric8-wit
space/authz/authz.go
InjectAuthzService
func InjectAuthzService(service AuthzService) goa.Middleware { return func(h goa.Handler) goa.Handler { return func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error { ctxWithAuthzServ := tokencontext.ContextWithSpaceAuthzService(ctx, &AuthzServiceManagerWrapper{Service: service, Config: servi...
go
func InjectAuthzService(service AuthzService) goa.Middleware { return func(h goa.Handler) goa.Handler { return func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error { ctxWithAuthzServ := tokencontext.ContextWithSpaceAuthzService(ctx, &AuthzServiceManagerWrapper{Service: service, Config: servi...
[ "func", "InjectAuthzService", "(", "service", "AuthzService", ")", "goa", ".", "Middleware", "{", "return", "func", "(", "h", "goa", ".", "Handler", ")", "goa", ".", "Handler", "{", "return", "func", "(", "ctx", "context", ".", "Context", ",", "rw", "htt...
// InjectAuthzService is a middleware responsible for setting up AuthzService in the context for every request.
[ "InjectAuthzService", "is", "a", "middleware", "responsible", "for", "setting", "up", "AuthzService", "in", "the", "context", "for", "every", "request", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/space/authz/authz.go#L139-L146
135,417
fabric8-services/fabric8-wit
space/authz/authz.go
Authorize
func Authorize(ctx context.Context, spaceID string) (bool, error) { srv := tokencontext.ReadSpaceAuthzServiceFromContext(ctx) if srv == nil { log.Error(ctx, map[string]interface{}{ "space_id": spaceID, }, "Missing space authz service") return false, errs.New("missing space authz service") } manager := srv...
go
func Authorize(ctx context.Context, spaceID string) (bool, error) { srv := tokencontext.ReadSpaceAuthzServiceFromContext(ctx) if srv == nil { log.Error(ctx, map[string]interface{}{ "space_id": spaceID, }, "Missing space authz service") return false, errs.New("missing space authz service") } manager := srv...
[ "func", "Authorize", "(", "ctx", "context", ".", "Context", ",", "spaceID", "string", ")", "(", "bool", ",", "error", ")", "{", "srv", ":=", "tokencontext", ".", "ReadSpaceAuthzServiceFromContext", "(", "ctx", ")", "\n", "if", "srv", "==", "nil", "{", "l...
// Authorize returns true and the corresponding Requesting Party Token if the current user is among the space collaborators
[ "Authorize", "returns", "true", "and", "the", "corresponding", "Requesting", "Party", "Token", "if", "the", "current", "user", "is", "among", "the", "space", "collaborators" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/space/authz/authz.go#L149-L160
135,418
fabric8-services/fabric8-wit
goasupport/forward_signer.go
Sign
func (f forwardSigner) Sign(request *http.Request) error { request.Header.Set("Authorization", "Bearer "+f.token) return nil }
go
func (f forwardSigner) Sign(request *http.Request) error { request.Header.Set("Authorization", "Bearer "+f.token) return nil }
[ "func", "(", "f", "forwardSigner", ")", "Sign", "(", "request", "*", "http", ".", "Request", ")", "error", "{", "request", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", "+", "f", ".", "token", ")", "\n", "return", "nil", "\n", "}" ...
// Sign set the Auth header
[ "Sign", "set", "the", "Auth", "header" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/goasupport/forward_signer.go#L17-L20
135,419
fabric8-services/fabric8-wit
goasupport/forward_signer.go
NewForwardSigner
func NewForwardSigner(ctx context.Context) goaclient.Signer { token := goajwt.ContextJWT(ctx) if token == nil { return nil } return &forwardSigner{token: token.Raw} }
go
func NewForwardSigner(ctx context.Context) goaclient.Signer { token := goajwt.ContextJWT(ctx) if token == nil { return nil } return &forwardSigner{token: token.Raw} }
[ "func", "NewForwardSigner", "(", "ctx", "context", ".", "Context", ")", "goaclient", ".", "Signer", "{", "token", ":=", "goajwt", ".", "ContextJWT", "(", "ctx", ")", "\n", "if", "token", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "&"...
// NewForwardSigner return a new signer based on current context
[ "NewForwardSigner", "return", "a", "new", "signer", "based", "on", "current", "context" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/goasupport/forward_signer.go#L23-L29
135,420
fabric8-services/fabric8-wit
controller/trackerquery.go
NewTrackerqueryController
func NewTrackerqueryController(service *goa.Service, db application.DB, scheduler *remoteworkitem.Scheduler, configuration trackerQueryConfiguration, authService auth.AuthService) *TrackerqueryController { return &TrackerqueryController{ Controller: service.NewController("TrackerqueryController"), db: ...
go
func NewTrackerqueryController(service *goa.Service, db application.DB, scheduler *remoteworkitem.Scheduler, configuration trackerQueryConfiguration, authService auth.AuthService) *TrackerqueryController { return &TrackerqueryController{ Controller: service.NewController("TrackerqueryController"), db: ...
[ "func", "NewTrackerqueryController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "scheduler", "*", "remoteworkitem", ".", "Scheduler", ",", "configuration", "trackerQueryConfiguration", ",", "authService", "auth", ".", "Au...
// NewTrackerqueryController creates a trackerquery controller.
[ "NewTrackerqueryController", "creates", "a", "trackerquery", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/trackerquery.go#L45-L53
135,421
fabric8-services/fabric8-wit
controller/trackerquery.go
ConvertTrackerQueriesToApp
func ConvertTrackerQueriesToApp(appl application.Application, request *http.Request, trackerqueries []remoteworkitem.TrackerQuery) []*app.TrackerQuery { var ls = []*app.TrackerQuery{} for _, i := range trackerqueries { ls = append(ls, convertTrackerQueryToApp(appl, request, i)) } return ls }
go
func ConvertTrackerQueriesToApp(appl application.Application, request *http.Request, trackerqueries []remoteworkitem.TrackerQuery) []*app.TrackerQuery { var ls = []*app.TrackerQuery{} for _, i := range trackerqueries { ls = append(ls, convertTrackerQueryToApp(appl, request, i)) } return ls }
[ "func", "ConvertTrackerQueriesToApp", "(", "appl", "application", ".", "Application", ",", "request", "*", "http", ".", "Request", ",", "trackerqueries", "[", "]", "remoteworkitem", ".", "TrackerQuery", ")", "[", "]", "*", "app", ".", "TrackerQuery", "{", "var...
// ConvertTrackerQueriesToApp from internal to external REST representation
[ "ConvertTrackerQueriesToApp", "from", "internal", "to", "external", "REST", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/trackerquery.go#L217-L223
135,422
fabric8-services/fabric8-wit
controller/trackerquery.go
convertTrackerQueryToApp
func convertTrackerQueryToApp(appl application.Application, request *http.Request, trackerquery remoteworkitem.TrackerQuery) *app.TrackerQuery { trackerQueryStringType := remoteworkitem.APIStringTypeTrackerQuery selfURL := rest.AbsoluteURL(request, app.TrackerqueryHref(trackerquery.ID)) t := &app.TrackerQuery{ Typ...
go
func convertTrackerQueryToApp(appl application.Application, request *http.Request, trackerquery remoteworkitem.TrackerQuery) *app.TrackerQuery { trackerQueryStringType := remoteworkitem.APIStringTypeTrackerQuery selfURL := rest.AbsoluteURL(request, app.TrackerqueryHref(trackerquery.ID)) t := &app.TrackerQuery{ Typ...
[ "func", "convertTrackerQueryToApp", "(", "appl", "application", ".", "Application", ",", "request", "*", "http", ".", "Request", ",", "trackerquery", "remoteworkitem", ".", "TrackerQuery", ")", "*", "app", ".", "TrackerQuery", "{", "trackerQueryStringType", ":=", ...
// ConvertTrackerQueryToApp converts from internal to external REST representation
[ "ConvertTrackerQueryToApp", "converts", "from", "internal", "to", "external", "REST", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/trackerquery.go#L226-L241
135,423
fabric8-services/fabric8-wit
criteria/expression_substring.go
Substring
func Substring(left Expression, right Expression) Expression { return reparent(&SubstringExpression{binaryExpression{expression{}, left, right}}) }
go
func Substring(left Expression, right Expression) Expression { return reparent(&SubstringExpression{binaryExpression{expression{}, left, right}}) }
[ "func", "Substring", "(", "left", "Expression", ",", "right", "Expression", ")", "Expression", "{", "return", "reparent", "(", "&", "SubstringExpression", "{", "binaryExpression", "{", "expression", "{", "}", ",", "left", ",", "right", "}", "}", ")", "\n", ...
// Substring constructs an SubstringExpression
[ "Substring", "constructs", "an", "SubstringExpression" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/criteria/expression_substring.go#L18-L20
135,424
fabric8-services/fabric8-wit
metric/recorder.go
Recorder
func Recorder() goa.Middleware { registerMetrics() return func(h goa.Handler) goa.Handler { return func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error { startTime := time.Now() err := h(ctx, rw, req) // record metrics method, entity, code := labelsVal(ctx) recordReqsTotal(met...
go
func Recorder() goa.Middleware { registerMetrics() return func(h goa.Handler) goa.Handler { return func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error { startTime := time.Now() err := h(ctx, rw, req) // record metrics method, entity, code := labelsVal(ctx) recordReqsTotal(met...
[ "func", "Recorder", "(", ")", "goa", ".", "Middleware", "{", "registerMetrics", "(", ")", "\n\n", "return", "func", "(", "h", "goa", ".", "Handler", ")", "goa", ".", "Handler", "{", "return", "func", "(", "ctx", "context", ".", "Context", ",", "rw", ...
// Recorder record prometheus metrics related to http request and response.
[ "Recorder", "record", "prometheus", "metrics", "related", "to", "http", "request", "and", "response", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/metric/recorder.go#L16-L34
135,425
fabric8-services/fabric8-wit
metric/recorder.go
entityVal
func entityVal(ctrl string) (entity string) { if strings.HasSuffix(ctrl, "Controller") { entity = strings.ToLower(strings.TrimSuffix(ctrl, "Controller")) } return entity }
go
func entityVal(ctrl string) (entity string) { if strings.HasSuffix(ctrl, "Controller") { entity = strings.ToLower(strings.TrimSuffix(ctrl, "Controller")) } return entity }
[ "func", "entityVal", "(", "ctrl", "string", ")", "(", "entity", "string", ")", "{", "if", "strings", ".", "HasSuffix", "(", "ctrl", ",", "\"", "\"", ")", "{", "entity", "=", "strings", ".", "ToLower", "(", "strings", ".", "TrimSuffix", "(", "ctrl", "...
// ctrl=SpaceController -> entity=space
[ "ctrl", "=", "SpaceController", "-", ">", "entity", "=", "space" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/metric/recorder.go#L70-L75
135,426
fabric8-services/fabric8-wit
metric/recorder.go
codeVal
func codeVal(status int) string { code := (status - (status % 100)) / 100 return strconv.Itoa(code) + "xx" }
go
func codeVal(status int) string { code := (status - (status % 100)) / 100 return strconv.Itoa(code) + "xx" }
[ "func", "codeVal", "(", "status", "int", ")", "string", "{", "code", ":=", "(", "status", "-", "(", "status", "%", "100", ")", ")", "/", "100", "\n", "return", "strconv", ".", "Itoa", "(", "code", ")", "+", "\"", "\"", "\n", "}" ]
// Group HTTP status code in the form of 2xx, 3xx etc.
[ "Group", "HTTP", "status", "code", "in", "the", "form", "of", "2xx", "3xx", "etc", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/metric/recorder.go#L78-L81
135,427
fabric8-services/fabric8-wit
resource/require.go
checkEnvVars
func checkEnvVars(envVars ...string) *string { var res string for _, envVar := range envVars { v, isSet := os.LookupEnv(envVar) // If we don't explicitly opt out from unit tests // by specifying F8_RESOURCE_UNIT_TEST=0 // we're going to run them if !isSet && envVar == UnitTest { continue } // Skip ...
go
func checkEnvVars(envVars ...string) *string { var res string for _, envVar := range envVars { v, isSet := os.LookupEnv(envVar) // If we don't explicitly opt out from unit tests // by specifying F8_RESOURCE_UNIT_TEST=0 // we're going to run them if !isSet && envVar == UnitTest { continue } // Skip ...
[ "func", "checkEnvVars", "(", "envVars", "...", "string", ")", "*", "string", "{", "var", "res", "string", "\n", "for", "_", ",", "envVar", ":=", "range", "envVars", "{", "v", ",", "isSet", ":=", "os", ".", "LookupEnv", "(", "envVar", ")", "\n\n", "//...
// checkEnvVars returns a skip reason if one of the given environment variables // cannot be found or evalutes to false.
[ "checkEnvVars", "returns", "a", "skip", "reason", "if", "one", "of", "the", "given", "environment", "variables", "cannot", "be", "found", "or", "evalutes", "to", "false", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/resource/require.go#L56-L86
135,428
fabric8-services/fabric8-wit
search/search_repository.go
NewGormSearchRepository
func NewGormSearchRepository(db *gorm.DB) *GormSearchRepository { return &GormSearchRepository{db, workitem.NewWorkItemTypeRepository(db)} }
go
func NewGormSearchRepository(db *gorm.DB) *GormSearchRepository { return &GormSearchRepository{db, workitem.NewWorkItemTypeRepository(db)} }
[ "func", "NewGormSearchRepository", "(", "db", "*", "gorm", ".", "DB", ")", "*", "GormSearchRepository", "{", "return", "&", "GormSearchRepository", "{", "db", ",", "workitem", ".", "NewWorkItemTypeRepository", "(", "db", ")", "}", "\n", "}" ]
// NewGormSearchRepository creates a new search repository
[ "NewGormSearchRepository", "creates", "a", "new", "search", "repository" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/search/search_repository.go#L57-L59
135,429
fabric8-services/fabric8-wit
search/search_repository.go
RegisterAsKnownURL
func RegisterAsKnownURL(name, urlRegex string) { compiledRegex := regexp.MustCompile(urlRegex) groupNames := compiledRegex.SubexpNames() knownURLLock.Lock() defer knownURLLock.Unlock() knownURLs[name] = KnownURL{ URLRegex: urlRegex, compiledRegex: regexp.MustCompile(urlRegex), groupNamesInRegex:...
go
func RegisterAsKnownURL(name, urlRegex string) { compiledRegex := regexp.MustCompile(urlRegex) groupNames := compiledRegex.SubexpNames() knownURLLock.Lock() defer knownURLLock.Unlock() knownURLs[name] = KnownURL{ URLRegex: urlRegex, compiledRegex: regexp.MustCompile(urlRegex), groupNamesInRegex:...
[ "func", "RegisterAsKnownURL", "(", "name", ",", "urlRegex", "string", ")", "{", "compiledRegex", ":=", "regexp", ".", "MustCompile", "(", "urlRegex", ")", "\n", "groupNames", ":=", "compiledRegex", ".", "SubexpNames", "(", ")", "\n", "knownURLLock", ".", "Lock...
// RegisterAsKnownURL appends to KnownURLs
[ "RegisterAsKnownURL", "appends", "to", "KnownURLs" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/search/search_repository.go#L95-L105
135,430
fabric8-services/fabric8-wit
search/search_repository.go
parseSearchString
func parseSearchString(ctx context.Context, rawSearchString string) (searchKeyword, error) { // TODO remove special characters and exclaimations if any rawSearchString = strings.Trim(rawSearchString, "/") // get rid of trailing slashes rawSearchString = strings.Trim(rawSearchString, "\"") parts := strings.Fields(ra...
go
func parseSearchString(ctx context.Context, rawSearchString string) (searchKeyword, error) { // TODO remove special characters and exclaimations if any rawSearchString = strings.Trim(rawSearchString, "/") // get rid of trailing slashes rawSearchString = strings.Trim(rawSearchString, "\"") parts := strings.Fields(ra...
[ "func", "parseSearchString", "(", "ctx", "context", ".", "Context", ",", "rawSearchString", "string", ")", "(", "searchKeyword", ",", "error", ")", "{", "// TODO remove special characters and exclaimations if any", "rawSearchString", "=", "strings", ".", "Trim", "(", ...
// parseSearchString accepts a raw string and generates a searchKeyword object
[ "parseSearchString", "accepts", "a", "raw", "string", "and", "generates", "a", "searchKeyword", "object" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/search/search_repository.go#L216-L268
135,431
fabric8-services/fabric8-wit
search/search_repository.go
ParseFilterString
func ParseFilterString(ctx context.Context, rawSearchString string) (criteria.Expression, *QueryOptions, error) { fm := map[string]interface{}{} // Parsing/Unmarshalling JSON encoding/json err := json.Unmarshal([]byte(rawSearchString), &fm) if err != nil { log.Error(ctx, map[string]interface{}{ "err": ...
go
func ParseFilterString(ctx context.Context, rawSearchString string) (criteria.Expression, *QueryOptions, error) { fm := map[string]interface{}{} // Parsing/Unmarshalling JSON encoding/json err := json.Unmarshal([]byte(rawSearchString), &fm) if err != nil { log.Error(ctx, map[string]interface{}{ "err": ...
[ "func", "ParseFilterString", "(", "ctx", "context", ".", "Context", ",", "rawSearchString", "string", ")", "(", "criteria", ".", "Expression", ",", "*", "QueryOptions", ",", "error", ")", "{", "fm", ":=", "map", "[", "string", "]", "interface", "{", "}", ...
// ParseFilterString accepts a raw string and generates a criteria expression
[ "ParseFilterString", "accepts", "a", "raw", "string", "and", "generates", "a", "criteria", "expression" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/search/search_repository.go#L545-L564
135,432
fabric8-services/fabric8-wit
search/search_repository.go
generateSQLSearchInfo
func generateSQLSearchInfo(keywords searchKeyword) (sqlParameter string) { numberStr := strings.Join(keywords.number, " & ") wordStr := strings.Join(keywords.words, " & ") var fragments []string for _, v := range []string{numberStr, wordStr} { if v != "" { fragments = append(fragments, v) } } searchStr := ...
go
func generateSQLSearchInfo(keywords searchKeyword) (sqlParameter string) { numberStr := strings.Join(keywords.number, " & ") wordStr := strings.Join(keywords.words, " & ") var fragments []string for _, v := range []string{numberStr, wordStr} { if v != "" { fragments = append(fragments, v) } } searchStr := ...
[ "func", "generateSQLSearchInfo", "(", "keywords", "searchKeyword", ")", "(", "sqlParameter", "string", ")", "{", "numberStr", ":=", "strings", ".", "Join", "(", "keywords", ".", "number", ",", "\"", "\"", ")", "\n", "wordStr", ":=", "strings", ".", "Join", ...
// generateSQLSearchInfo accepts searchKeyword and join them in a way that can be used in sql
[ "generateSQLSearchInfo", "accepts", "searchKeyword", "and", "join", "them", "in", "a", "way", "that", "can", "be", "used", "in", "sql" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/search/search_repository.go#L567-L578
135,433
fabric8-services/fabric8-wit
search/search_repository.go
SearchFullText
func (r *GormSearchRepository) SearchFullText(ctx context.Context, rawSearchString string, start *int, limit *int, spaceID *string) ([]workitem.WorkItem, int, error) { // parse // generateSearchQuery // .... parsedSearchDict, err := parseSearchString(ctx, rawSearchString) if err != nil { return nil, 0, errs.With...
go
func (r *GormSearchRepository) SearchFullText(ctx context.Context, rawSearchString string, start *int, limit *int, spaceID *string) ([]workitem.WorkItem, int, error) { // parse // generateSearchQuery // .... parsedSearchDict, err := parseSearchString(ctx, rawSearchString) if err != nil { return nil, 0, errs.With...
[ "func", "(", "r", "*", "GormSearchRepository", ")", "SearchFullText", "(", "ctx", "context", ".", "Context", ",", "rawSearchString", "string", ",", "start", "*", "int", ",", "limit", "*", "int", ",", "spaceID", "*", "string", ")", "(", "[", "]", "workite...
// SearchFullText Search returns work items for the given query
[ "SearchFullText", "Search", "returns", "work", "items", "for", "the", "given", "query" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/search/search_repository.go#L663-L701
135,434
fabric8-services/fabric8-wit
tool/wit-cli/main.go
newJWTSigner
func newJWTSigner(key, format string) goaclient.Signer { return &goaclient.APIKeySigner{ SignQuery: false, KeyName: "Authorization", KeyValue: key, Format: format, } }
go
func newJWTSigner(key, format string) goaclient.Signer { return &goaclient.APIKeySigner{ SignQuery: false, KeyName: "Authorization", KeyValue: key, Format: format, } }
[ "func", "newJWTSigner", "(", "key", ",", "format", "string", ")", "goaclient", ".", "Signer", "{", "return", "&", "goaclient", ".", "APIKeySigner", "{", "SignQuery", ":", "false", ",", "KeyName", ":", "\"", "\"", ",", "KeyValue", ":", "key", ",", "Format...
// newJWTSigner returns the request signer used for authenticating // against the jwt security scheme.
[ "newJWTSigner", "returns", "the", "request", "signer", "used", "for", "authenticating", "against", "the", "jwt", "security", "scheme", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/tool/wit-cli/main.go#L64-L72
135,435
fabric8-services/fabric8-wit
criteria/criteria.go
IterateParents
func IterateParents(exp Expression, f func(Expression) bool) { if exp != nil { exp = exp.Parent() } for exp != nil { if !f(exp) { return } exp = exp.Parent() } }
go
func IterateParents(exp Expression, f func(Expression) bool) { if exp != nil { exp = exp.Parent() } for exp != nil { if !f(exp) { return } exp = exp.Parent() } }
[ "func", "IterateParents", "(", "exp", "Expression", ",", "f", "func", "(", "Expression", ")", "bool", ")", "{", "if", "exp", "!=", "nil", "{", "exp", "=", "exp", ".", "Parent", "(", ")", "\n", "}", "\n", "for", "exp", "!=", "nil", "{", "if", "!",...
// IterateParents calls f for every member of the parent chain // Stops iterating if f returns false
[ "IterateParents", "calls", "f", "for", "every", "member", "of", "the", "parent", "chain", "Stops", "iterating", "if", "f", "returns", "false" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/criteria/criteria.go#L5-L15
135,436
fabric8-services/fabric8-wit
controller/permission.go
CRUDWorkItem
func (p *PermissionDefinition) CRUDWorkItem() []string { return []string{p.CreateWorkItem, p.ReadWorkItem, p.UpdateWorkItem, p.DeleteWorkItem} }
go
func (p *PermissionDefinition) CRUDWorkItem() []string { return []string{p.CreateWorkItem, p.ReadWorkItem, p.UpdateWorkItem, p.DeleteWorkItem} }
[ "func", "(", "p", "*", "PermissionDefinition", ")", "CRUDWorkItem", "(", ")", "[", "]", "string", "{", "return", "[", "]", "string", "{", "p", ".", "CreateWorkItem", ",", "p", ".", "ReadWorkItem", ",", "p", ".", "UpdateWorkItem", ",", "p", ".", "Delete...
// CRUDWorkItem returns all CRUD permissions for a WorkItem
[ "CRUDWorkItem", "returns", "all", "CRUD", "permissions", "for", "a", "WorkItem" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/permission.go#L12-L14
135,437
fabric8-services/fabric8-wit
criteria/expression_and.go
And
func And(left Expression, right Expression) Expression { return reparent(&AndExpression{binaryExpression{expression{}, left, right}}) }
go
func And(left Expression, right Expression) Expression { return reparent(&AndExpression{binaryExpression{expression{}, left, right}}) }
[ "func", "And", "(", "left", "Expression", ",", "right", "Expression", ")", "Expression", "{", "return", "reparent", "(", "&", "AndExpression", "{", "binaryExpression", "{", "expression", "{", "}", ",", "left", ",", "right", "}", "}", ")", "\n", "}" ]
// And constructs an AndExpression
[ "And", "constructs", "an", "AndExpression" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/criteria/expression_and.go#L18-L20
135,438
fabric8-services/fabric8-wit
rendering/markdown.go
MarkdownCommonHighlighter
func MarkdownCommonHighlighter(input []byte) []byte { renderer := highlightHTMLRenderer{blackfriday.HtmlRenderer(commonHTMLFlags, "", ""), 0} return blackfriday.MarkdownOptions(input, &renderer, blackfriday.Options{ Extensions: commonExtensions}) }
go
func MarkdownCommonHighlighter(input []byte) []byte { renderer := highlightHTMLRenderer{blackfriday.HtmlRenderer(commonHTMLFlags, "", ""), 0} return blackfriday.MarkdownOptions(input, &renderer, blackfriday.Options{ Extensions: commonExtensions}) }
[ "func", "MarkdownCommonHighlighter", "(", "input", "[", "]", "byte", ")", "[", "]", "byte", "{", "renderer", ":=", "highlightHTMLRenderer", "{", "blackfriday", ".", "HtmlRenderer", "(", "commonHTMLFlags", ",", "\"", "\"", ",", "\"", "\"", ")", ",", "0", "}...
// MarkdownCommonHighlighter uses the blackfriday.MarkdownCommon setup but also includes // code-prettify formatting of BlockCode segments
[ "MarkdownCommonHighlighter", "uses", "the", "blackfriday", ".", "MarkdownCommon", "setup", "but", "also", "includes", "code", "-", "prettify", "formatting", "of", "BlockCode", "segments" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/rendering/markdown.go#L36-L40
135,439
fabric8-services/fabric8-wit
rendering/markdown.go
ListItem
func (h *highlightHTMLRenderer) ListItem(out *bytes.Buffer, text []byte, flags int) { switch { case bytes.HasPrefix(text, []byte("[ ] ")): text = append([]byte(fmt.Sprintf(`<input class="markdown-checkbox" type="checkbox" disabled="disabled" data-checkbox-index="%d"></input>`, h.checkboxIndex)), text[4:]...) h.ch...
go
func (h *highlightHTMLRenderer) ListItem(out *bytes.Buffer, text []byte, flags int) { switch { case bytes.HasPrefix(text, []byte("[ ] ")): text = append([]byte(fmt.Sprintf(`<input class="markdown-checkbox" type="checkbox" disabled="disabled" data-checkbox-index="%d"></input>`, h.checkboxIndex)), text[4:]...) h.ch...
[ "func", "(", "h", "*", "highlightHTMLRenderer", ")", "ListItem", "(", "out", "*", "bytes", ".", "Buffer", ",", "text", "[", "]", "byte", ",", "flags", "int", ")", "{", "switch", "{", "case", "bytes", ".", "HasPrefix", "(", "text", ",", "[", "]", "b...
// ListItem overrides the default ListItem render and adds support for GH-style // checkboxes on service side. For the contents of the list item beyond the // checkbox prefix, the default Html.ListItem is called. // This adds a data-checkbox-index attribute that contains the ordinal of the // checkbox in the rendered M...
[ "ListItem", "overrides", "the", "default", "ListItem", "render", "and", "adds", "support", "for", "GH", "-", "style", "checkboxes", "on", "service", "side", ".", "For", "the", "contents", "of", "the", "list", "item", "beyond", "the", "checkbox", "prefix", "t...
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/rendering/markdown.go#L53-L63
135,440
fabric8-services/fabric8-wit
rendering/markdown.go
BlockCode
func (h highlightHTMLRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string) { highlighted, err := syntaxhighlight.AsHTML(text) if err != nil { h.Renderer.BlockCode(out, text, lang) } else { if out.Len() > 0 { out.WriteByte('\n') } // parse out the language names/classes count := 0 for _, e...
go
func (h highlightHTMLRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string) { highlighted, err := syntaxhighlight.AsHTML(text) if err != nil { h.Renderer.BlockCode(out, text, lang) } else { if out.Len() > 0 { out.WriteByte('\n') } // parse out the language names/classes count := 0 for _, e...
[ "func", "(", "h", "highlightHTMLRenderer", ")", "BlockCode", "(", "out", "*", "bytes", ".", "Buffer", ",", "text", "[", "]", "byte", ",", "lang", "string", ")", "{", "highlighted", ",", "err", ":=", "syntaxhighlight", ".", "AsHTML", "(", "text", ")", "...
// BlackCode overrides the standard Html Renderer to add support for prettify of source code within block // If highlighter fail, normal Html.BlockCode is called
[ "BlackCode", "overrides", "the", "standard", "Html", "Renderer", "to", "add", "support", "for", "prettify", "of", "source", "code", "within", "block", "If", "highlighter", "fail", "normal", "Html", ".", "BlockCode", "is", "called" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/rendering/markdown.go#L67-L104
135,441
fabric8-services/fabric8-wit
workitem/workitem_repository.go
ParseSortWorkItemsBy
func ParseSortWorkItemsBy(s *string) (SortWorkItemsBy, error) { if s == nil { // this is the default case // which returns workitems with highest execution order return SortWorkItemsByDefault, nil } var sort SortWorkItemsBy switch *s { case "execution": sort = SortWorkItemsByExecutionAsc case "-execution...
go
func ParseSortWorkItemsBy(s *string) (SortWorkItemsBy, error) { if s == nil { // this is the default case // which returns workitems with highest execution order return SortWorkItemsByDefault, nil } var sort SortWorkItemsBy switch *s { case "execution": sort = SortWorkItemsByExecutionAsc case "-execution...
[ "func", "ParseSortWorkItemsBy", "(", "s", "*", "string", ")", "(", "SortWorkItemsBy", ",", "error", ")", "{", "if", "s", "==", "nil", "{", "// this is the default case", "// which returns workitems with highest execution order", "return", "SortWorkItemsByDefault", ",", ...
// ParseSortWorkItemsBy parses the string input and returns object of type SortWorkItemsBy // which can directly be used while querying database to order the output.
[ "ParseSortWorkItemsBy", "parses", "the", "string", "input", "and", "returns", "object", "of", "type", "SortWorkItemsBy", "which", "can", "directly", "be", "used", "while", "querying", "database", "to", "order", "the", "output", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L62-L87
135,442
fabric8-services/fabric8-wit
workitem/workitem_repository.go
NewWorkItemRepository
func NewWorkItemRepository(db *gorm.DB) *GormWorkItemRepository { repository := &GormWorkItemRepository{ db: db, winr: numbersequence.NewWorkItemNumberSequenceRepository(db), witr: &GormWorkItemTypeRepository{db}, wirr: &GormRevisionRepository{db}, space: space.NewRepository(db), } return repository ...
go
func NewWorkItemRepository(db *gorm.DB) *GormWorkItemRepository { repository := &GormWorkItemRepository{ db: db, winr: numbersequence.NewWorkItemNumberSequenceRepository(db), witr: &GormWorkItemTypeRepository{db}, wirr: &GormRevisionRepository{db}, space: space.NewRepository(db), } return repository ...
[ "func", "NewWorkItemRepository", "(", "db", "*", "gorm", ".", "DB", ")", "*", "GormWorkItemRepository", "{", "repository", ":=", "&", "GormWorkItemRepository", "{", "db", ":", "db", ",", "winr", ":", "numbersequence", ".", "NewWorkItemNumberSequenceRepository", "(...
// NewWorkItemRepository creates a GormWorkItemRepository
[ "NewWorkItemRepository", "creates", "a", "GormWorkItemRepository" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L110-L119
135,443
fabric8-services/fabric8-wit
workitem/workitem_repository.go
LoadBatchFromDB
func (r *GormWorkItemRepository) LoadBatchFromDB(ctx context.Context, ids []uuid.UUID) ([]WorkItemStorage, error) { log.Info(nil, map[string]interface{}{ "wi_ids": ids, }, "Loading work items") res := []WorkItemStorage{} tx := r.db.Model(WorkItemStorage{}).Where("id IN (?)", ids).Find(&res) if tx.Error != nil {...
go
func (r *GormWorkItemRepository) LoadBatchFromDB(ctx context.Context, ids []uuid.UUID) ([]WorkItemStorage, error) { log.Info(nil, map[string]interface{}{ "wi_ids": ids, }, "Loading work items") res := []WorkItemStorage{} tx := r.db.Model(WorkItemStorage{}).Where("id IN (?)", ids).Find(&res) if tx.Error != nil {...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "LoadBatchFromDB", "(", "ctx", "context", ".", "Context", ",", "ids", "[", "]", "uuid", ".", "UUID", ")", "(", "[", "]", "WorkItemStorage", ",", "error", ")", "{", "log", ".", "Info", "(", "nil", ...
// LoadBatchFromDB returns the work items using IN query expression.
[ "LoadBatchFromDB", "returns", "the", "work", "items", "using", "IN", "query", "expression", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L155-L166
135,444
fabric8-services/fabric8-wit
workitem/workitem_repository.go
LoadByID
func (r *GormWorkItemRepository) LoadByID(ctx context.Context, id uuid.UUID) (*WorkItem, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "loadById"}, time.Now()) res, err := r.LoadFromDB(ctx, id) if err != nil { return nil, errs.WithStack(err) } wiType, err := r.witr.Load(ctx, res.Type) if err...
go
func (r *GormWorkItemRepository) LoadByID(ctx context.Context, id uuid.UUID) (*WorkItem, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "loadById"}, time.Now()) res, err := r.LoadFromDB(ctx, id) if err != nil { return nil, errs.WithStack(err) } wiType, err := r.witr.Load(ctx, res.Type) if err...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "LoadByID", "(", "ctx", "context", ".", "Context", ",", "id", "uuid", ".", "UUID", ")", "(", "*", "WorkItem", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", ...
// LoadByID returns the work item for the given id // returns NotFoundError, ConversionError or InternalError
[ "LoadByID", "returns", "the", "work", "item", "for", "the", "given", "id", "returns", "NotFoundError", "ConversionError", "or", "InternalError" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L170-L181
135,445
fabric8-services/fabric8-wit
workitem/workitem_repository.go
LoadBatchByID
func (r *GormWorkItemRepository) LoadBatchByID(ctx context.Context, ids []uuid.UUID) ([]*WorkItem, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "loadBatchById"}, time.Now()) res, err := r.LoadBatchFromDB(ctx, ids) if err != nil { return nil, errs.WithStack(err) } workitems := []*WorkItem{} ...
go
func (r *GormWorkItemRepository) LoadBatchByID(ctx context.Context, ids []uuid.UUID) ([]*WorkItem, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "loadBatchById"}, time.Now()) res, err := r.LoadBatchFromDB(ctx, ids) if err != nil { return nil, errs.WithStack(err) } workitems := []*WorkItem{} ...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "LoadBatchByID", "(", "ctx", "context", ".", "Context", ",", "ids", "[", "]", "uuid", ".", "UUID", ")", "(", "[", "]", "*", "WorkItem", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", ...
// LoadBatchByID returns work items for the given ids
[ "LoadBatchByID", "returns", "work", "items", "for", "the", "given", "ids" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L184-L210
135,446
fabric8-services/fabric8-wit
workitem/workitem_repository.go
Load
func (r *GormWorkItemRepository) Load(ctx context.Context, spaceID uuid.UUID, wiNumber int) (*WorkItem, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "load"}, time.Now()) wiStorage, wiType, err := r.loadWorkItemStorage(ctx, spaceID, wiNumber, false) if err != nil { return nil, err } return Co...
go
func (r *GormWorkItemRepository) Load(ctx context.Context, spaceID uuid.UUID, wiNumber int) (*WorkItem, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "load"}, time.Now()) wiStorage, wiType, err := r.loadWorkItemStorage(ctx, spaceID, wiNumber, false) if err != nil { return nil, err } return Co...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "Load", "(", "ctx", "context", ".", "Context", ",", "spaceID", "uuid", ".", "UUID", ",", "wiNumber", "int", ")", "(", "*", "WorkItem", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(...
// Load returns the work item for the given spaceID and item id // returns NotFoundError, ConversionError or InternalError
[ "Load", "returns", "the", "work", "item", "for", "the", "given", "spaceID", "and", "item", "id", "returns", "NotFoundError", "ConversionError", "or", "InternalError" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L214-L221
135,447
fabric8-services/fabric8-wit
workitem/workitem_repository.go
LookupIDByNamedSpaceAndNumber
func (r *GormWorkItemRepository) LookupIDByNamedSpaceAndNumber(ctx context.Context, ownerName, spaceName string, wiNumber int) (*uuid.UUID, *uuid.UUID, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "lookupIDByNamedSpaceAndNumber"}, time.Now()) log.Debug(nil, map[string]interface{}{ "wi_number": ...
go
func (r *GormWorkItemRepository) LookupIDByNamedSpaceAndNumber(ctx context.Context, ownerName, spaceName string, wiNumber int) (*uuid.UUID, *uuid.UUID, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "lookupIDByNamedSpaceAndNumber"}, time.Now()) log.Debug(nil, map[string]interface{}{ "wi_number": ...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "LookupIDByNamedSpaceAndNumber", "(", "ctx", "context", ".", "Context", ",", "ownerName", ",", "spaceName", "string", ",", "wiNumber", "int", ")", "(", "*", "uuid", ".", "UUID", ",", "*", "uuid", ".", "...
// LookupIDByNamedSpaceAndNumber returns the work item's ID for the given owner name, space name and item number // returns NotFoundError, ConversionError or InternalError
[ "LookupIDByNamedSpaceAndNumber", "returns", "the", "work", "item", "s", "ID", "for", "the", "given", "owner", "name", "space", "name", "and", "item", "number", "returns", "NotFoundError", "ConversionError", "or", "InternalError" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L225-L266
135,448
fabric8-services/fabric8-wit
workitem/workitem_repository.go
LoadBottomWorkitem
func (r *GormWorkItemRepository) LoadBottomWorkitem(ctx context.Context, spaceID uuid.UUID) (*WorkItem, error) { res := WorkItemStorage{} db := r.db.Model(WorkItemStorage{}) query := fmt.Sprintf("execution_order = (SELECT min(execution_order) FROM %[1]s where space_id=?)", WorkItemStorage{}.TableName(), ) db = d...
go
func (r *GormWorkItemRepository) LoadBottomWorkitem(ctx context.Context, spaceID uuid.UUID) (*WorkItem, error) { res := WorkItemStorage{} db := r.db.Model(WorkItemStorage{}) query := fmt.Sprintf("execution_order = (SELECT min(execution_order) FROM %[1]s where space_id=?)", WorkItemStorage{}.TableName(), ) db = d...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "LoadBottomWorkitem", "(", "ctx", "context", ".", "Context", ",", "spaceID", "uuid", ".", "UUID", ")", "(", "*", "WorkItem", ",", "error", ")", "{", "res", ":=", "WorkItemStorage", "{", "}", "\n", "db...
// LoadBottomWorkitem returns bottom work item of the list. Bottom most workitem has the lowest order. // returns NotFoundError, ConversionError or InternalError
[ "LoadBottomWorkitem", "returns", "bottom", "work", "item", "of", "the", "list", ".", "Bottom", "most", "workitem", "has", "the", "lowest", "order", ".", "returns", "NotFoundError", "ConversionError", "or", "InternalError" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L324-L339
135,449
fabric8-services/fabric8-wit
workitem/workitem_repository.go
LoadHighestOrder
func (r *GormWorkItemRepository) LoadHighestOrder(ctx context.Context, spaceID uuid.UUID) (float64, error) { res := WorkItemStorage{} db := r.db.Model(WorkItemStorage{}) query := fmt.Sprintf("execution_order = (SELECT max(execution_order) FROM %[1]s where space_id=?)", WorkItemStorage{}.TableName(), ) db = db.Wh...
go
func (r *GormWorkItemRepository) LoadHighestOrder(ctx context.Context, spaceID uuid.UUID) (float64, error) { res := WorkItemStorage{} db := r.db.Model(WorkItemStorage{}) query := fmt.Sprintf("execution_order = (SELECT max(execution_order) FROM %[1]s where space_id=?)", WorkItemStorage{}.TableName(), ) db = db.Wh...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "LoadHighestOrder", "(", "ctx", "context", ".", "Context", ",", "spaceID", "uuid", ".", "UUID", ")", "(", "float64", ",", "error", ")", "{", "res", ":=", "WorkItemStorage", "{", "}", "\n", "db", ":=",...
// LoadHighestOrder returns the highest execution order in the given space
[ "LoadHighestOrder", "returns", "the", "highest", "execution", "order", "in", "the", "given", "space" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L342-L357
135,450
fabric8-services/fabric8-wit
workitem/workitem_repository.go
Delete
func (r *GormWorkItemRepository) Delete(ctx context.Context, workitemID uuid.UUID, suppressorID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "workitem", "delete"}, time.Now()) var workItem = WorkItemStorage{} workItem.ID = workitemID // retrieve the current version of the work item to delete r.d...
go
func (r *GormWorkItemRepository) Delete(ctx context.Context, workitemID uuid.UUID, suppressorID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "workitem", "delete"}, time.Now()) var workItem = WorkItemStorage{} workItem.ID = workitemID // retrieve the current version of the work item to delete r.d...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "workitemID", "uuid", ".", "UUID", ",", "suppressorID", "uuid", ".", "UUID", ")", "error", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]"...
// Delete deletes the work item with the given id // returns NotFoundError or InternalError
[ "Delete", "deletes", "the", "work", "item", "with", "the", "given", "id", "returns", "NotFoundError", "or", "InternalError" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L361-L382
135,451
fabric8-services/fabric8-wit
workitem/workitem_repository.go
FindFirstItem
func (r *GormWorkItemRepository) FindFirstItem(ctx context.Context, spaceID uuid.UUID, id uuid.UUID) (*float64, error) { res := WorkItemStorage{} tx := r.db.Model(WorkItemStorage{}).Where("id=? and space_id=?", id, spaceID).First(&res) if tx.RecordNotFound() { return nil, errors.NewNotFoundError("work item", id.St...
go
func (r *GormWorkItemRepository) FindFirstItem(ctx context.Context, spaceID uuid.UUID, id uuid.UUID) (*float64, error) { res := WorkItemStorage{} tx := r.db.Model(WorkItemStorage{}).Where("id=? and space_id=?", id, spaceID).First(&res) if tx.RecordNotFound() { return nil, errors.NewNotFoundError("work item", id.St...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "FindFirstItem", "(", "ctx", "context", ".", "Context", ",", "spaceID", "uuid", ".", "UUID", ",", "id", "uuid", ".", "UUID", ")", "(", "*", "float64", ",", "error", ")", "{", "res", ":=", "WorkItemS...
// FindFirstItem returns the order of the target workitem
[ "FindFirstItem", "returns", "the", "order", "of", "the", "target", "workitem" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L425-L435
135,452
fabric8-services/fabric8-wit
workitem/workitem_repository.go
ConvertWorkItemStorageToModel
func ConvertWorkItemStorageToModel(wiType *WorkItemType, wi *WorkItemStorage) (*WorkItem, error) { result, err := wiType.ConvertWorkItemStorageToModel(*wi) if err != nil { return nil, errors.NewConversionError(err.Error()) } if _, ok := wiType.Fields[SystemCreatedAt]; ok { result.Fields[SystemCreatedAt] = wi.Cr...
go
func ConvertWorkItemStorageToModel(wiType *WorkItemType, wi *WorkItemStorage) (*WorkItem, error) { result, err := wiType.ConvertWorkItemStorageToModel(*wi) if err != nil { return nil, errors.NewConversionError(err.Error()) } if _, ok := wiType.Fields[SystemCreatedAt]; ok { result.Fields[SystemCreatedAt] = wi.Cr...
[ "func", "ConvertWorkItemStorageToModel", "(", "wiType", "*", "WorkItemType", ",", "wi", "*", "WorkItemStorage", ")", "(", "*", "WorkItem", ",", "error", ")", "{", "result", ",", "err", ":=", "wiType", ".", "ConvertWorkItemStorageToModel", "(", "*", "wi", ")", ...
// ConvertWorkItemStorageToModel convert work item model to app WI
[ "ConvertWorkItemStorageToModel", "convert", "work", "item", "model", "to", "app", "WI" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L766-L785
135,453
fabric8-services/fabric8-wit
workitem/workitem_repository.go
Count
func (r *GormWorkItemRepository) Count(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (int, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "count"}, time.Now()) where, parameters, joins, compileError := Compile(criteria) if compileError != nil { return 0, errors.NewBadPar...
go
func (r *GormWorkItemRepository) Count(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (int, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "count"}, time.Now()) where, parameters, joins, compileError := Compile(criteria) if compileError != nil { return 0, errors.NewBadPar...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "Count", "(", "ctx", "context", ".", "Context", ",", "spaceID", "uuid", ".", "UUID", ",", "criteria", "criteria", ".", "Expression", ")", "(", "int", ",", "error", ")", "{", "defer", "goa", ".", "Me...
// Count returns the amount of work item that satisfy the given criteria.Expression
[ "Count", "returns", "the", "amount", "of", "work", "item", "that", "satisfy", "the", "given", "criteria", ".", "Expression" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L908-L932
135,454
fabric8-services/fabric8-wit
workitem/workitem_repository.go
GetCountsPerIteration
func (r *GormWorkItemRepository) GetCountsPerIteration(ctx context.Context, spaceID uuid.UUID) (map[string]WICountsPerIteration, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "getCountsPerIteration"}, time.Now()) db := r.db.Model(&iteration.Iteration{}).Where("space_id = ?", spaceID) if db.Error ...
go
func (r *GormWorkItemRepository) GetCountsPerIteration(ctx context.Context, spaceID uuid.UUID) (map[string]WICountsPerIteration, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "getCountsPerIteration"}, time.Now()) db := r.db.Model(&iteration.Iteration{}).Where("space_id = ?", spaceID) if db.Error ...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "GetCountsPerIteration", "(", "ctx", "context", ".", "Context", ",", "spaceID", "uuid", ".", "UUID", ")", "(", "map", "[", "string", "]", "WICountsPerIteration", ",", "error", ")", "{", "defer", "goa", ...
// GetCountsPerIteration counts WIs including iteration-children and returns a map of iterationID->WICountsPerIteration
[ "GetCountsPerIteration", "counts", "WIs", "including", "iteration", "-", "children", "and", "returns", "a", "map", "of", "iterationID", "-", ">", "WICountsPerIteration" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L1062-L1079
135,455
fabric8-services/fabric8-wit
workitem/workitem_repository.go
LoadByIteration
func (r *GormWorkItemRepository) LoadByIteration(ctx context.Context, iterationID uuid.UUID) ([]*WorkItem, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "loadByIteration"}, time.Now()) log.Info(nil, map[string]interface{}{ "itr_id": iterationID, }, "Loading work items for iteration") res := [...
go
func (r *GormWorkItemRepository) LoadByIteration(ctx context.Context, iterationID uuid.UUID) ([]*WorkItem, error) { defer goa.MeasureSince([]string{"goa", "db", "workitem", "loadByIteration"}, time.Now()) log.Info(nil, map[string]interface{}{ "itr_id": iterationID, }, "Loading work items for iteration") res := [...
[ "func", "(", "r", "*", "GormWorkItemRepository", ")", "LoadByIteration", "(", "ctx", "context", ".", "Context", ",", "iterationID", "uuid", ".", "UUID", ")", "(", "[", "]", "*", "WorkItem", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "("...
// LoadByIteration returns the list of work items belongs to given iteration
[ "LoadByIteration", "returns", "the", "list", "of", "work", "items", "belongs", "to", "given", "iteration" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_repository.go#L1145-L1178
135,456
fabric8-services/fabric8-wit
controller/namedspaces.go
NewNamedspacesController
func NewNamedspacesController(service *goa.Service, db application.DB) *NamedspacesController { return &NamedspacesController{Controller: service.NewController("NamedspacesController"), db: db} }
go
func NewNamedspacesController(service *goa.Service, db application.DB) *NamedspacesController { return &NamedspacesController{Controller: service.NewController("NamedspacesController"), db: db} }
[ "func", "NewNamedspacesController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ")", "*", "NamedspacesController", "{", "return", "&", "NamedspacesController", "{", "Controller", ":", "service", ".", "NewController", "(", "\"...
// NewNamedspacesController creates a namedspaces controller.
[ "NewNamedspacesController", "creates", "a", "namedspaces", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/namedspaces.go#L23-L25
135,457
fabric8-services/fabric8-wit
workitem/workitem_storage.go
Equal
func (wi WorkItemStorage) Equal(u convert.Equaler) bool { other, ok := u.(WorkItemStorage) if !ok { return false } if !convert.CascadeEqual(wi.Lifecycle, other.Lifecycle) { return false } if wi.Number != other.Number { return false } if wi.Type != other.Type { return false } if wi.ID != other.ID { r...
go
func (wi WorkItemStorage) Equal(u convert.Equaler) bool { other, ok := u.(WorkItemStorage) if !ok { return false } if !convert.CascadeEqual(wi.Lifecycle, other.Lifecycle) { return false } if wi.Number != other.Number { return false } if wi.Type != other.Type { return false } if wi.ID != other.ID { r...
[ "func", "(", "wi", "WorkItemStorage", ")", "Equal", "(", "u", "convert", ".", "Equaler", ")", "bool", "{", "other", ",", "ok", ":=", "u", ".", "(", "WorkItemStorage", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n", "if", "!", ...
// Equal returns true if two WorkItem objects are equal; otherwise false is returned.
[ "Equal", "returns", "true", "if", "two", "WorkItem", "objects", "are", "equal", ";", "otherwise", "false", "is", "returned", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_storage.go#L50-L83
135,458
fabric8-services/fabric8-wit
workitem/workitem_storage.go
ParseWorkItemIDToUint64
func ParseWorkItemIDToUint64(wiIDStr string) (uint64, error) { wiID, err := strconv.ParseUint(wiIDStr, 10, 64) if err != nil { return 0, errors.NewNotFoundError("work item ID", wiIDStr) } return wiID, nil }
go
func ParseWorkItemIDToUint64(wiIDStr string) (uint64, error) { wiID, err := strconv.ParseUint(wiIDStr, 10, 64) if err != nil { return 0, errors.NewNotFoundError("work item ID", wiIDStr) } return wiID, nil }
[ "func", "ParseWorkItemIDToUint64", "(", "wiIDStr", "string", ")", "(", "uint64", ",", "error", ")", "{", "wiID", ",", "err", ":=", "strconv", ".", "ParseUint", "(", "wiIDStr", ",", "10", ",", "64", ")", "\n", "if", "err", "!=", "nil", "{", "return", ...
// ParseWorkItemIDToUint64 does what it says
[ "ParseWorkItemIDToUint64", "does", "what", "it", "says" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitem_storage.go#L98-L104
135,459
fabric8-services/fabric8-wit
migration/migration.go
MigrateToNextVersion
func MigrateToNextVersion(tx *sql.Tx, nextVersion *int64, m Migrations, catalog string) error { // Obtain exclusive transaction level advisory that doesn't depend on any table. // Once obtained, the lock is held for the remainder of the current transaction. // (There is no UNLOCK TABLE command; locks are always rele...
go
func MigrateToNextVersion(tx *sql.Tx, nextVersion *int64, m Migrations, catalog string) error { // Obtain exclusive transaction level advisory that doesn't depend on any table. // Once obtained, the lock is held for the remainder of the current transaction. // (There is no UNLOCK TABLE command; locks are always rele...
[ "func", "MigrateToNextVersion", "(", "tx", "*", "sql", ".", "Tx", ",", "nextVersion", "*", "int64", ",", "m", "Migrations", ",", "catalog", "string", ")", "error", "{", "// Obtain exclusive transaction level advisory that doesn't depend on any table.", "// Once obtained, ...
// MigrateToNextVersion migrates the database to the nextVersion. // If the database is already at nextVersion or higher, the nextVersion // will be set to the actual next version.
[ "MigrateToNextVersion", "migrates", "the", "database", "to", "the", "nextVersion", ".", "If", "the", "database", "is", "already", "at", "nextVersion", "or", "higher", "the", "nextVersion", "will", "be", "set", "to", "the", "actual", "next", "version", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/migration/migration.go#L545-L591
135,460
fabric8-services/fabric8-wit
migration/migration.go
getCurrentVersion
func getCurrentVersion(db *sql.Tx, catalog string) (int64, error) { query := `SELECT EXISTS( SELECT 1 FROM information_schema.tables WHERE table_catalog=$1 AND table_name='version')` row := db.QueryRow(query, catalog) var exists bool if err := row.Scan(&exists); err != nil { return -1, errs.Errorf(`f...
go
func getCurrentVersion(db *sql.Tx, catalog string) (int64, error) { query := `SELECT EXISTS( SELECT 1 FROM information_schema.tables WHERE table_catalog=$1 AND table_name='version')` row := db.QueryRow(query, catalog) var exists bool if err := row.Scan(&exists); err != nil { return -1, errs.Errorf(`f...
[ "func", "getCurrentVersion", "(", "db", "*", "sql", ".", "Tx", ",", "catalog", "string", ")", "(", "int64", ",", "error", ")", "{", "query", ":=", "`SELECT EXISTS(\n\t\t\t\tSELECT 1 FROM information_schema.tables\n\t\t\t\tWHERE table_catalog=$1\n\t\t\t\tAND table_name='versio...
// getCurrentVersion returns the highest version from the version // table or -1 if that table does not exist. // // Returning -1 simplifies the logic of the migration process because // the next version is always the current version + 1 which results // in -1 + 1 = 0 which is exactly what we want as the first version.
[ "getCurrentVersion", "returns", "the", "highest", "version", "from", "the", "version", "table", "or", "-", "1", "if", "that", "table", "does", "not", "exist", ".", "Returning", "-", "1", "simplifies", "the", "logic", "of", "the", "migration", "process", "bec...
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/migration/migration.go#L599-L624
135,461
fabric8-services/fabric8-wit
workitem/json_storage.go
Validate
func (j *FieldDefinitions) Validate() error { if j == nil { return errs.New("fields not defined") } for name, field := range *j { if err := field.Validate(); err != nil { return errs.Wrapf(err, "failed to validate field %s", name) } } return nil }
go
func (j *FieldDefinitions) Validate() error { if j == nil { return errs.New("fields not defined") } for name, field := range *j { if err := field.Validate(); err != nil { return errs.Wrapf(err, "failed to validate field %s", name) } } return nil }
[ "func", "(", "j", "*", "FieldDefinitions", ")", "Validate", "(", ")", "error", "{", "if", "j", "==", "nil", "{", "return", "errs", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "for", "name", ",", "field", ":=", "range", "*", "j", "{", "if...
// Validate checks that each field definition is valid
[ "Validate", "checks", "that", "each", "field", "definition", "is", "valid" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/json_storage.go#L73-L83
135,462
fabric8-services/fabric8-wit
controller/endpoints.go
NewEndpointsController
func NewEndpointsController(service *goa.Service) *EndpointsController { return &EndpointsController{ Controller: service.NewController("EndpointsController"), FileHandler: workingFileFetcher{}, } }
go
func NewEndpointsController(service *goa.Service) *EndpointsController { return &EndpointsController{ Controller: service.NewController("EndpointsController"), FileHandler: workingFileFetcher{}, } }
[ "func", "NewEndpointsController", "(", "service", "*", "goa", ".", "Service", ")", "*", "EndpointsController", "{", "return", "&", "EndpointsController", "{", "Controller", ":", "service", ".", "NewController", "(", "\"", "\"", ")", ",", "FileHandler", ":", "w...
// NewEndpointsController creates an endpoints controller.
[ "NewEndpointsController", "creates", "an", "endpoints", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/endpoints.go#L47-L52
135,463
fabric8-services/fabric8-wit
controller/endpoints.go
getEndpoints
func getEndpoints(ctx *app.ListEndpointsContext, fileHandler asseter) (*app.Endpoints, error) { // Get an unmarshal swagger specification swaggerJSON, err := fileHandler.Asset(embeddedSwaggerSpecFile) if err != nil { // TODO(tinakurian): fix error handling return nil, errors.NewNotFoundError("file", embeddedSwag...
go
func getEndpoints(ctx *app.ListEndpointsContext, fileHandler asseter) (*app.Endpoints, error) { // Get an unmarshal swagger specification swaggerJSON, err := fileHandler.Asset(embeddedSwaggerSpecFile) if err != nil { // TODO(tinakurian): fix error handling return nil, errors.NewNotFoundError("file", embeddedSwag...
[ "func", "getEndpoints", "(", "ctx", "*", "app", ".", "ListEndpointsContext", ",", "fileHandler", "asseter", ")", "(", "*", "app", ".", "Endpoints", ",", "error", ")", "{", "// Get an unmarshal swagger specification", "swaggerJSON", ",", "err", ":=", "fileHandler",...
// Get a list of all endpoints formatted to json api format.
[ "Get", "a", "list", "of", "all", "endpoints", "formatted", "to", "json", "api", "format", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/endpoints.go#L73-L156
135,464
fabric8-services/fabric8-wit
controller/deployments_urlprovider.go
NewURLProvider
func NewURLProvider(ctx context.Context, config *configuration.Registry, osioclient OpenshiftIOClient) (kubernetes.BaseURLProvider, error) { userServices, err := osioclient.GetUserServices(ctx) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "error accessing Tenant API") return nil, er...
go
func NewURLProvider(ctx context.Context, config *configuration.Registry, osioclient OpenshiftIOClient) (kubernetes.BaseURLProvider, error) { userServices, err := osioclient.GetUserServices(ctx) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "error accessing Tenant API") return nil, er...
[ "func", "NewURLProvider", "(", "ctx", "context", ".", "Context", ",", "config", "*", "configuration", ".", "Registry", ",", "osioclient", "OpenshiftIOClient", ")", "(", "kubernetes", ".", "BaseURLProvider", ",", "error", ")", "{", "userServices", ",", "err", "...
// NewURLProvider looks at what servers are available and create a BaseURLProvder that fits
[ "NewURLProvider", "looks", "at", "what", "servers", "are", "available", "and", "create", "a", "BaseURLProvder", "that", "fits" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments_urlprovider.go#L92-L134
135,465
fabric8-services/fabric8-wit
controller/deployments_urlprovider.go
newTenantURLProviderFromTenant
func newTenantURLProviderFromTenant(t *app.UserService, token string, proxyURL string) (*tenantURLProvider, error) { if t.ID == nil { log.Error(nil, map[string]interface{}{}, "app.UserService is malformed: no ID field") return nil, errs.New("app.UserService is malformed: no ID field") } if t.Attributes == nil ...
go
func newTenantURLProviderFromTenant(t *app.UserService, token string, proxyURL string) (*tenantURLProvider, error) { if t.ID == nil { log.Error(nil, map[string]interface{}{}, "app.UserService is malformed: no ID field") return nil, errs.New("app.UserService is malformed: no ID field") } if t.Attributes == nil ...
[ "func", "newTenantURLProviderFromTenant", "(", "t", "*", "app", ".", "UserService", ",", "token", "string", ",", "proxyURL", "string", ")", "(", "*", "tenantURLProvider", ",", "error", ")", "{", "if", "t", ".", "ID", "==", "nil", "{", "log", ".", "Error"...
// newTenantURLProviderFromTenant create a provider from a UserService object
[ "newTenantURLProviderFromTenant", "create", "a", "provider", "from", "a", "UserService", "object" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments_urlprovider.go#L137-L181
135,466
fabric8-services/fabric8-wit
controller/deployments_urlprovider.go
GetEnvironmentMapping
func (up *tenantURLProvider) GetEnvironmentMapping() map[string]string { result := make(map[string]string) // Exclude internal namespaces where the user cannot deploy applications // Deployments API will receive requests by environment name (e.g. "run", "stage"). // These names correspond to the "type" attribute i...
go
func (up *tenantURLProvider) GetEnvironmentMapping() map[string]string { result := make(map[string]string) // Exclude internal namespaces where the user cannot deploy applications // Deployments API will receive requests by environment name (e.g. "run", "stage"). // These names correspond to the "type" attribute i...
[ "func", "(", "up", "*", "tenantURLProvider", ")", "GetEnvironmentMapping", "(", ")", "map", "[", "string", "]", "string", "{", "result", ":=", "make", "(", "map", "[", "string", "]", "string", ")", "\n", "// Exclude internal namespaces where the user cannot deploy...
// GetEnvironmentMapping returns a map whose keys are environment names, and values are the Kubernetes namespaces // that represent those environments
[ "GetEnvironmentMapping", "returns", "a", "map", "whose", "keys", "are", "environment", "names", "and", "values", "are", "the", "Kubernetes", "namespaces", "that", "represent", "those", "environments" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments_urlprovider.go#L190-L207
135,467
fabric8-services/fabric8-wit
controller/deployments_urlprovider.go
CanDeploy
func (up *tenantURLProvider) CanDeploy(envType string) bool { _, pres := internalNamespaceTypes[envType] return !pres }
go
func (up *tenantURLProvider) CanDeploy(envType string) bool { _, pres := internalNamespaceTypes[envType] return !pres }
[ "func", "(", "up", "*", "tenantURLProvider", ")", "CanDeploy", "(", "envType", "string", ")", "bool", "{", "_", ",", "pres", ":=", "internalNamespaceTypes", "[", "envType", "]", "\n", "return", "!", "pres", "\n", "}" ]
// CanDeploy returns true if the environment type provided can be deployed to as part of a pipeline
[ "CanDeploy", "returns", "true", "if", "the", "environment", "type", "provided", "can", "be", "deployed", "to", "as", "part", "of", "a", "pipeline" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/deployments_urlprovider.go#L213-L216
135,468
fabric8-services/fabric8-wit
controller/features.go
NewFeaturesController
func NewFeaturesController(service *goa.Service, config FeaturesControllerConfiguration) *FeaturesController { return &FeaturesController{ Controller: service.NewController("FeaturesController"), config: config, } }
go
func NewFeaturesController(service *goa.Service, config FeaturesControllerConfiguration) *FeaturesController { return &FeaturesController{ Controller: service.NewController("FeaturesController"), config: config, } }
[ "func", "NewFeaturesController", "(", "service", "*", "goa", ".", "Service", ",", "config", "FeaturesControllerConfiguration", ")", "*", "FeaturesController", "{", "return", "&", "FeaturesController", "{", "Controller", ":", "service", ".", "NewController", "(", "\"...
// NewFeaturesController creates a features controller.
[ "NewFeaturesController", "creates", "a", "features", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/features.go#L21-L26
135,469
fabric8-services/fabric8-wit
controller/area.go
NewAreaController
func NewAreaController(service *goa.Service, db application.DB, config AreaControllerConfiguration) *AreaController { return &AreaController{ Controller: service.NewController("AreaController"), db: db, config: config} }
go
func NewAreaController(service *goa.Service, db application.DB, config AreaControllerConfiguration) *AreaController { return &AreaController{ Controller: service.NewController("AreaController"), db: db, config: config} }
[ "func", "NewAreaController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "AreaControllerConfiguration", ")", "*", "AreaController", "{", "return", "&", "AreaController", "{", "Controller", ":", "service", ".", ...
// NewAreaController creates a area controller.
[ "NewAreaController", "creates", "a", "area", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/area.go#L40-L45
135,470
fabric8-services/fabric8-wit
controller/area.go
ShowChildren
func (c *AreaController) ShowChildren(ctx *app.ShowChildrenAreaContext) error { id, err := uuid.FromString(ctx.ID) if err != nil { return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error())) } var children []area.Area err = application.Transactional(c.db, func(appl application.Application) error { pare...
go
func (c *AreaController) ShowChildren(ctx *app.ShowChildrenAreaContext) error { id, err := uuid.FromString(ctx.ID) if err != nil { return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error())) } var children []area.Area err = application.Transactional(c.db, func(appl application.Application) error { pare...
[ "func", "(", "c", "*", "AreaController", ")", "ShowChildren", "(", "ctx", "*", "app", ".", "ShowChildrenAreaContext", ")", "error", "{", "id", ",", "err", ":=", "uuid", ".", "FromString", "(", "ctx", ".", "ID", ")", "\n", "if", "err", "!=", "nil", "{...
// ShowChildren runs the show-children action
[ "ShowChildren", "runs", "the", "show", "-", "children", "action" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/area.go#L48-L71
135,471
fabric8-services/fabric8-wit
controller/area.go
ConvertAreas
func ConvertAreas(db application.DB, request *http.Request, areas []area.Area, additional ...AreaConvertFunc) []*app.Area { var is = []*app.Area{} for _, i := range areas { is = append(is, ConvertArea(db, request, i, additional...)) } return is }
go
func ConvertAreas(db application.DB, request *http.Request, areas []area.Area, additional ...AreaConvertFunc) []*app.Area { var is = []*app.Area{} for _, i := range areas { is = append(is, ConvertArea(db, request, i, additional...)) } return is }
[ "func", "ConvertAreas", "(", "db", "application", ".", "DB", ",", "request", "*", "http", ".", "Request", ",", "areas", "[", "]", "area", ".", "Area", ",", "additional", "...", "AreaConvertFunc", ")", "[", "]", "*", "app", ".", "Area", "{", "var", "i...
// ConvertAreas converts between internal and external REST representation
[ "ConvertAreas", "converts", "between", "internal", "and", "external", "REST", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/area.go#L193-L199
135,472
fabric8-services/fabric8-wit
controller/area.go
ConvertArea
func ConvertArea(db application.DB, request *http.Request, ar area.Area, options ...AreaConvertFunc) *app.Area { relatedURL := rest.AbsoluteURL(request, app.AreaHref(ar.ID)) childURL := rest.AbsoluteURL(request, app.AreaHref(ar.ID)+"/children") spaceRelatedURL := rest.AbsoluteURL(request, app.SpaceHref(ar.SpaceID)) ...
go
func ConvertArea(db application.DB, request *http.Request, ar area.Area, options ...AreaConvertFunc) *app.Area { relatedURL := rest.AbsoluteURL(request, app.AreaHref(ar.ID)) childURL := rest.AbsoluteURL(request, app.AreaHref(ar.ID)+"/children") spaceRelatedURL := rest.AbsoluteURL(request, app.SpaceHref(ar.SpaceID)) ...
[ "func", "ConvertArea", "(", "db", "application", ".", "DB", ",", "request", "*", "http", ".", "Request", ",", "ar", "area", ".", "Area", ",", "options", "...", "AreaConvertFunc", ")", "*", "app", ".", "Area", "{", "relatedURL", ":=", "rest", ".", "Abso...
// ConvertArea converts between internal and external REST representation
[ "ConvertArea", "converts", "between", "internal", "and", "external", "REST", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/area.go#L202-L260
135,473
fabric8-services/fabric8-wit
controller/area.go
ConvertAreaSimple
func ConvertAreaSimple(request *http.Request, id interface{}) (*app.GenericData, *app.GenericLinks) { t := area.APIStringTypeAreas i := fmt.Sprint(id) data := &app.GenericData{ Type: &t, ID: &i, } relatedURL := rest.AbsoluteURL(request, app.AreaHref(i)) links := &app.GenericLinks{ Self: &relatedURL, ...
go
func ConvertAreaSimple(request *http.Request, id interface{}) (*app.GenericData, *app.GenericLinks) { t := area.APIStringTypeAreas i := fmt.Sprint(id) data := &app.GenericData{ Type: &t, ID: &i, } relatedURL := rest.AbsoluteURL(request, app.AreaHref(i)) links := &app.GenericLinks{ Self: &relatedURL, ...
[ "func", "ConvertAreaSimple", "(", "request", "*", "http", ".", "Request", ",", "id", "interface", "{", "}", ")", "(", "*", "app", ".", "GenericData", ",", "*", "app", ".", "GenericLinks", ")", "{", "t", ":=", "area", ".", "APIStringTypeAreas", "\n", "i...
// ConvertAreaSimple converts a simple area ID into a Generic Relationship // data+links element
[ "ConvertAreaSimple", "converts", "a", "simple", "area", "ID", "into", "a", "Generic", "Relationship", "data", "+", "links", "element" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/area.go#L264-L277
135,474
fabric8-services/fabric8-wit
controller/work_item_type_group.go
NewWorkItemTypeGroupController
func NewWorkItemTypeGroupController(service *goa.Service, db application.DB) *WorkItemTypeGroupController { return &WorkItemTypeGroupController{ Controller: service.NewController("WorkItemTypeGroupController"), db: db, } }
go
func NewWorkItemTypeGroupController(service *goa.Service, db application.DB) *WorkItemTypeGroupController { return &WorkItemTypeGroupController{ Controller: service.NewController("WorkItemTypeGroupController"), db: db, } }
[ "func", "NewWorkItemTypeGroupController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ")", "*", "WorkItemTypeGroupController", "{", "return", "&", "WorkItemTypeGroupController", "{", "Controller", ":", "service", ".", "NewControl...
// NewWorkItemTypeGroupController creates a work_item_type_group controller.
[ "NewWorkItemTypeGroupController", "creates", "a", "work_item_type_group", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_type_group.go#L27-L32
135,475
fabric8-services/fabric8-wit
controller/work_item_type_group.go
Show
func (c *WorkItemTypeGroupController) Show(ctx *app.ShowWorkItemTypeGroupContext) error { var typeGroup *workitem.WorkItemTypeGroup var err error err = application.Transactional(c.db, func(appl application.Application) error { typeGroup, err = appl.WorkItemTypeGroups().Load(ctx, ctx.GroupID) if err != nil { r...
go
func (c *WorkItemTypeGroupController) Show(ctx *app.ShowWorkItemTypeGroupContext) error { var typeGroup *workitem.WorkItemTypeGroup var err error err = application.Transactional(c.db, func(appl application.Application) error { typeGroup, err = appl.WorkItemTypeGroups().Load(ctx, ctx.GroupID) if err != nil { r...
[ "func", "(", "c", "*", "WorkItemTypeGroupController", ")", "Show", "(", "ctx", "*", "app", ".", "ShowWorkItemTypeGroupContext", ")", "error", "{", "var", "typeGroup", "*", "workitem", ".", "WorkItemTypeGroup", "\n", "var", "err", "error", "\n", "err", "=", "...
// Show runs the list action.
[ "Show", "runs", "the", "list", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_type_group.go#L35-L51
135,476
fabric8-services/fabric8-wit
controller/work_item_type_group.go
ConvertTypeGroup
func ConvertTypeGroup(request *http.Request, tg workitem.WorkItemTypeGroup) *app.WorkItemTypeGroupData { workitemtypes := "workitemtypes" workItemTypeGroupRelatedURL := rest.AbsoluteURL(request, app.WorkItemTypeGroupHref(tg.ID)) createdAt := tg.CreatedAt.UTC() updatedAt := tg.UpdatedAt.UTC() // Every work item typ...
go
func ConvertTypeGroup(request *http.Request, tg workitem.WorkItemTypeGroup) *app.WorkItemTypeGroupData { workitemtypes := "workitemtypes" workItemTypeGroupRelatedURL := rest.AbsoluteURL(request, app.WorkItemTypeGroupHref(tg.ID)) createdAt := tg.CreatedAt.UTC() updatedAt := tg.UpdatedAt.UTC() // Every work item typ...
[ "func", "ConvertTypeGroup", "(", "request", "*", "http", ".", "Request", ",", "tg", "workitem", ".", "WorkItemTypeGroup", ")", "*", "app", ".", "WorkItemTypeGroupData", "{", "workitemtypes", ":=", "\"", "\"", "\n", "workItemTypeGroupRelatedURL", ":=", "rest", "....
// ConvertTypeGroup converts WorkitemTypeGroup model to a response resource // object for jsonapi.org specification
[ "ConvertTypeGroup", "converts", "WorkitemTypeGroup", "model", "to", "a", "response", "resource", "object", "for", "jsonapi", ".", "org", "specification" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_type_group.go#L55-L104
135,477
fabric8-services/fabric8-wit
gormapplication/application.go
Commit
func (g *GormTransaction) Commit() error { err := g.db.Commit().Error g.db = nil return errors.WithStack(err) }
go
func (g *GormTransaction) Commit() error { err := g.db.Commit().Error g.db = nil return errors.WithStack(err) }
[ "func", "(", "g", "*", "GormTransaction", ")", "Commit", "(", ")", "error", "{", "err", ":=", "g", ".", "db", ".", "Commit", "(", ")", ".", "Error", "\n", "g", ".", "db", "=", "nil", "\n", "return", "errors", ".", "WithStack", "(", "err", ")", ...
// Commit implements TransactionSupport
[ "Commit", "implements", "TransactionSupport" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/gormapplication/application.go#L204-L208
135,478
fabric8-services/fabric8-wit
codebase/che/client.go
NewStarterClient
func NewStarterClient(cheStarterURL, openshiftMasterURL string, namespace string, client *http.Client) Client { return &StarterClient{cheStarterURL: cheStarterURL, openshiftMasterURL: openshiftMasterURL, namespace: namespace, client: client} }
go
func NewStarterClient(cheStarterURL, openshiftMasterURL string, namespace string, client *http.Client) Client { return &StarterClient{cheStarterURL: cheStarterURL, openshiftMasterURL: openshiftMasterURL, namespace: namespace, client: client} }
[ "func", "NewStarterClient", "(", "cheStarterURL", ",", "openshiftMasterURL", "string", ",", "namespace", "string", ",", "client", "*", "http", ".", "Client", ")", "Client", "{", "return", "&", "StarterClient", "{", "cheStarterURL", ":", "cheStarterURL", ",", "op...
// NewStarterClient is a helper function to create a new CheStarter client // Uses http.DefaultClient
[ "NewStarterClient", "is", "a", "helper", "function", "to", "create", "a", "new", "CheStarter", "client", "Uses", "http", ".", "DefaultClient" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/codebase/che/client.go#L29-L31
135,479
fabric8-services/fabric8-wit
codebase/che/client.go
CreateWorkspace
func (cs *StarterClient) CreateWorkspace(ctx context.Context, workspace WorkspaceRequest) (*WorkspaceResponse, error) { body, err := json.Marshal(&workspace) if err != nil { log.Error(ctx, map[string]interface{}{ "workspace_id": workspace.Name, "workspace_stack_id": workspace.StackID, "workspace": ...
go
func (cs *StarterClient) CreateWorkspace(ctx context.Context, workspace WorkspaceRequest) (*WorkspaceResponse, error) { body, err := json.Marshal(&workspace) if err != nil { log.Error(ctx, map[string]interface{}{ "workspace_id": workspace.Name, "workspace_stack_id": workspace.StackID, "workspace": ...
[ "func", "(", "cs", "*", "StarterClient", ")", "CreateWorkspace", "(", "ctx", "context", ".", "Context", ",", "workspace", "WorkspaceRequest", ")", "(", "*", "WorkspaceResponse", ",", "error", ")", "{", "body", ",", "err", ":=", "json", ".", "Marshal", "(",...
// CreateWorkspace creates a new Che Workspace based on a repository
[ "CreateWorkspace", "creates", "a", "new", "Che", "Workspace", "based", "on", "a", "repository" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/codebase/che/client.go#L112-L177
135,480
fabric8-services/fabric8-wit
codebase/che/client.go
DeleteWorkspace
func (cs *StarterClient) DeleteWorkspace(ctx context.Context, workspaceName string) error { req, err := http.NewRequest("DELETE", cs.targetURL(fmt.Sprintf("workspace/%s", workspaceName)), nil) if err != nil { log.Error(ctx, map[string]interface{}{ "name": workspaceName, "masterURL": cs.cheStarterURL, ...
go
func (cs *StarterClient) DeleteWorkspace(ctx context.Context, workspaceName string) error { req, err := http.NewRequest("DELETE", cs.targetURL(fmt.Sprintf("workspace/%s", workspaceName)), nil) if err != nil { log.Error(ctx, map[string]interface{}{ "name": workspaceName, "masterURL": cs.cheStarterURL, ...
[ "func", "(", "cs", "*", "StarterClient", ")", "DeleteWorkspace", "(", "ctx", "context", ".", "Context", ",", "workspaceName", "string", ")", "error", "{", "req", ",", "err", ":=", "http", ".", "NewRequest", "(", "\"", "\"", ",", "cs", ".", "targetURL", ...
// DeleteWorkspace deletes a Che Workspace by its name
[ "DeleteWorkspace", "deletes", "a", "Che", "Workspace", "by", "its", "name" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/codebase/che/client.go#L180-L235
135,481
fabric8-services/fabric8-wit
codebase/che/client.go
GetCheServerState
func (cs *StarterClient) GetCheServerState(ctx context.Context) (*ServerStateResponse, error) { req, err := http.NewRequest("GET", cs.targetURL("server"), nil) if err != nil { return nil, err } cs.setHeaders(ctx, req) if log.IsDebug() { b, _ := httputil.DumpRequest(req, true) log.Debug(ctx, map[string]int...
go
func (cs *StarterClient) GetCheServerState(ctx context.Context) (*ServerStateResponse, error) { req, err := http.NewRequest("GET", cs.targetURL("server"), nil) if err != nil { return nil, err } cs.setHeaders(ctx, req) if log.IsDebug() { b, _ := httputil.DumpRequest(req, true) log.Debug(ctx, map[string]int...
[ "func", "(", "cs", "*", "StarterClient", ")", "GetCheServerState", "(", "ctx", "context", ".", "Context", ")", "(", "*", "ServerStateResponse", ",", "error", ")", "{", "req", ",", "err", ":=", "http", ".", "NewRequest", "(", "\"", "\"", ",", "cs", ".",...
// GetCheServerState get che server state.
[ "GetCheServerState", "get", "che", "server", "state", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/codebase/che/client.go#L293-L341
135,482
fabric8-services/fabric8-wit
remoteworkitem/jira.go
Fetch
func (j *JiraTracker) Fetch(authToken string) chan TrackerItemContent { f := jiraIssueFetcher{} client, _ := jira.NewClient(nil, j.URL) f.client = client return j.fetch(&f) }
go
func (j *JiraTracker) Fetch(authToken string) chan TrackerItemContent { f := jiraIssueFetcher{} client, _ := jira.NewClient(nil, j.URL) f.client = client return j.fetch(&f) }
[ "func", "(", "j", "*", "JiraTracker", ")", "Fetch", "(", "authToken", "string", ")", "chan", "TrackerItemContent", "{", "f", ":=", "jiraIssueFetcher", "{", "}", "\n", "client", ",", "_", ":=", "jira", ".", "NewClient", "(", "nil", ",", "j", ".", "URL",...
// Fetch collects data from Jira
[ "Fetch", "collects", "data", "from", "Jira" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/remoteworkitem/jira.go#L33-L38
135,483
fabric8-services/fabric8-wit
workitem/link/ancestor.go
GetDistinctAncestorIDs
func (l AncestorList) GetDistinctAncestorIDs() id.Slice { m := id.Map{} for _, ancestor := range l { m[ancestor.ID] = struct{}{} } return m.ToSlice() }
go
func (l AncestorList) GetDistinctAncestorIDs() id.Slice { m := id.Map{} for _, ancestor := range l { m[ancestor.ID] = struct{}{} } return m.ToSlice() }
[ "func", "(", "l", "AncestorList", ")", "GetDistinctAncestorIDs", "(", ")", "id", ".", "Slice", "{", "m", ":=", "id", ".", "Map", "{", "}", "\n", "for", "_", ",", "ancestor", ":=", "range", "l", "{", "m", "[", "ancestor", ".", "ID", "]", "=", "str...
// GetDistinctAncestorIDs returns a list with distinct ancestor IDs.
[ "GetDistinctAncestorIDs", "returns", "a", "list", "with", "distinct", "ancestor", "IDs", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/ancestor.go#L35-L41
135,484
fabric8-services/fabric8-wit
workitem/link/ancestor.go
GetParentOf
func (l AncestorList) GetParentOf(workItemID uuid.UUID) *Ancestor { for _, a := range l { if a.DirectChildID == workItemID { return &a } } return nil }
go
func (l AncestorList) GetParentOf(workItemID uuid.UUID) *Ancestor { for _, a := range l { if a.DirectChildID == workItemID { return &a } } return nil }
[ "func", "(", "l", "AncestorList", ")", "GetParentOf", "(", "workItemID", "uuid", ".", "UUID", ")", "*", "Ancestor", "{", "for", "_", ",", "a", ":=", "range", "l", "{", "if", "a", ".", "DirectChildID", "==", "workItemID", "{", "return", "&", "a", "\n"...
// GetParentOf returns the first parent item that we can find in the list of // ancestors; otherwise nil is returned.
[ "GetParentOf", "returns", "the", "first", "parent", "item", "that", "we", "can", "find", "in", "the", "list", "of", "ancestors", ";", "otherwise", "nil", "is", "returned", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/ancestor.go#L45-L52
135,485
fabric8-services/fabric8-wit
workitem/typegroup.go
Equal
func (witg WorkItemTypeGroup) Equal(u convert.Equaler) bool { other, ok := u.(WorkItemTypeGroup) if !ok { return false } if witg.ID != other.ID { return false } if witg.SpaceTemplateID != other.SpaceTemplateID { return false } if !convert.CascadeEqual(witg.Lifecycle, other.Lifecycle) { return false } ...
go
func (witg WorkItemTypeGroup) Equal(u convert.Equaler) bool { other, ok := u.(WorkItemTypeGroup) if !ok { return false } if witg.ID != other.ID { return false } if witg.SpaceTemplateID != other.SpaceTemplateID { return false } if !convert.CascadeEqual(witg.Lifecycle, other.Lifecycle) { return false } ...
[ "func", "(", "witg", "WorkItemTypeGroup", ")", "Equal", "(", "u", "convert", ".", "Equaler", ")", "bool", "{", "other", ",", "ok", ":=", "u", ".", "(", "WorkItemTypeGroup", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n", "if", ...
// Equal returns true if two WorkItemTypeGroup objects are equal; otherwise false is returned.
[ "Equal", "returns", "true", "if", "two", "WorkItemTypeGroup", "objects", "are", "equal", ";", "otherwise", "false", "is", "returned", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/typegroup.go#L59-L97
135,486
fabric8-services/fabric8-wit
workitem/typegroup.go
TypeGroups
func TypeGroups() []WorkItemTypeGroup { scenariosID := uuid.FromStringOrNil("feb28a28-44a6-43f8-946a-bae987713891") experiencesID := uuid.FromStringOrNil("d4e2c859-f416-4e9a-a3e0-e7bb4e1b454b") requirementsID := uuid.FromStringOrNil("bb1de8b6-3175-4821-abe9-50d0a64f19a2") executionID := uuid.FromStringOrNil("7fdfde...
go
func TypeGroups() []WorkItemTypeGroup { scenariosID := uuid.FromStringOrNil("feb28a28-44a6-43f8-946a-bae987713891") experiencesID := uuid.FromStringOrNil("d4e2c859-f416-4e9a-a3e0-e7bb4e1b454b") requirementsID := uuid.FromStringOrNil("bb1de8b6-3175-4821-abe9-50d0a64f19a2") executionID := uuid.FromStringOrNil("7fdfde...
[ "func", "TypeGroups", "(", ")", "[", "]", "WorkItemTypeGroup", "{", "scenariosID", ":=", "uuid", ".", "FromStringOrNil", "(", "\"", "\"", ")", "\n", "experiencesID", ":=", "uuid", ".", "FromStringOrNil", "(", "\"", "\"", ")", "\n", "requirementsID", ":=", ...
// TypeGroups returns the list of work item type groups
[ "TypeGroups", "returns", "the", "list", "of", "work", "item", "type", "groups" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/typegroup.go#L133-L186
135,487
fabric8-services/fabric8-wit
workitem/typegroup.go
TypeGroupByName
func TypeGroupByName(name string) *WorkItemTypeGroup { for _, t := range TypeGroups() { if t.Name == name { return &t } } return nil }
go
func TypeGroupByName(name string) *WorkItemTypeGroup { for _, t := range TypeGroups() { if t.Name == name { return &t } } return nil }
[ "func", "TypeGroupByName", "(", "name", "string", ")", "*", "WorkItemTypeGroup", "{", "for", "_", ",", "t", ":=", "range", "TypeGroups", "(", ")", "{", "if", "t", ".", "Name", "==", "name", "{", "return", "&", "t", "\n", "}", "\n", "}", "\n", "retu...
// TypeGroupByName returns a type group based on its name if such a group // exists; otherwise nil is returned.
[ "TypeGroupByName", "returns", "a", "type", "group", "based", "on", "its", "name", "if", "such", "a", "group", "exists", ";", "otherwise", "nil", "is", "returned", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/typegroup.go#L190-L197
135,488
fabric8-services/fabric8-wit
workitem/typegroup.go
TypeGroupsByBucket
func TypeGroupsByBucket(bucket TypeBucket) []WorkItemTypeGroup { res := []WorkItemTypeGroup{} for _, t := range TypeGroups() { if t.Bucket == bucket { res = append(res, t) } } return res }
go
func TypeGroupsByBucket(bucket TypeBucket) []WorkItemTypeGroup { res := []WorkItemTypeGroup{} for _, t := range TypeGroups() { if t.Bucket == bucket { res = append(res, t) } } return res }
[ "func", "TypeGroupsByBucket", "(", "bucket", "TypeBucket", ")", "[", "]", "WorkItemTypeGroup", "{", "res", ":=", "[", "]", "WorkItemTypeGroup", "{", "}", "\n", "for", "_", ",", "t", ":=", "range", "TypeGroups", "(", ")", "{", "if", "t", ".", "Bucket", ...
// TypeGroupsByBucket returns all type groups which fall into the given bucket
[ "TypeGroupsByBucket", "returns", "all", "type", "groups", "which", "fall", "into", "the", "given", "bucket" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/typegroup.go#L200-L208
135,489
fabric8-services/fabric8-wit
controller/workitemtypes.go
NewWorkitemtypesController
func NewWorkitemtypesController(service *goa.Service, db application.DB, config workItemTypesControllerConfiguration) *WorkitemtypesController { return &WorkitemtypesController{ Controller: service.NewController("WorkitemtypesController"), db: db, config: config, } }
go
func NewWorkitemtypesController(service *goa.Service, db application.DB, config workItemTypesControllerConfiguration) *WorkitemtypesController { return &WorkitemtypesController{ Controller: service.NewController("WorkitemtypesController"), db: db, config: config, } }
[ "func", "NewWorkitemtypesController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "workItemTypesControllerConfiguration", ")", "*", "WorkitemtypesController", "{", "return", "&", "WorkitemtypesController", "{", "Cont...
// NewWorkitemtypesController creates a workitemtype controller.
[ "NewWorkitemtypesController", "creates", "a", "workitemtype", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/workitemtypes.go#L25-L31
135,490
fabric8-services/fabric8-wit
controller/workitemtypes.go
List
func (c *WorkitemtypesController) List(ctx *app.ListWorkitemtypesContext) error { log.Debug(ctx, map[string]interface{}{"space_id": ctx.SpaceTemplateID}, "Listing work item types per space template") result := &app.WorkItemTypeList{} err := application.Transactional(c.db, func(appl application.Application) error { ...
go
func (c *WorkitemtypesController) List(ctx *app.ListWorkitemtypesContext) error { log.Debug(ctx, map[string]interface{}{"space_id": ctx.SpaceTemplateID}, "Listing work item types per space template") result := &app.WorkItemTypeList{} err := application.Transactional(c.db, func(appl application.Application) error { ...
[ "func", "(", "c", "*", "WorkitemtypesController", ")", "List", "(", "ctx", "*", "app", ".", "ListWorkitemtypesContext", ")", "error", "{", "log", ".", "Debug", "(", "ctx", ",", "map", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ":", "...
// List runs the list action
[ "List", "runs", "the", "list", "action" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/workitemtypes.go#L34-L58
135,491
fabric8-services/fabric8-wit
controller/space_codebases.go
NewSpaceCodebasesController
func NewSpaceCodebasesController(service *goa.Service, db application.DB) *SpaceCodebasesController { return &SpaceCodebasesController{Controller: service.NewController("SpaceCodebasesController"), db: db} }
go
func NewSpaceCodebasesController(service *goa.Service, db application.DB) *SpaceCodebasesController { return &SpaceCodebasesController{Controller: service.NewController("SpaceCodebasesController"), db: db} }
[ "func", "NewSpaceCodebasesController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ")", "*", "SpaceCodebasesController", "{", "return", "&", "SpaceCodebasesController", "{", "Controller", ":", "service", ".", "NewController", "...
// NewSpaceCodebasesController creates a space-codebases controller.
[ "NewSpaceCodebasesController", "creates", "a", "space", "-", "codebases", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/space_codebases.go#L22-L24
135,492
fabric8-services/fabric8-wit
criteria/expression_equals.go
Equals
func Equals(left Expression, right Expression) Expression { return reparent(&EqualsExpression{binaryExpression{expression{}, left, right}}) }
go
func Equals(left Expression, right Expression) Expression { return reparent(&EqualsExpression{binaryExpression{expression{}, left, right}}) }
[ "func", "Equals", "(", "left", "Expression", ",", "right", "Expression", ")", "Expression", "{", "return", "reparent", "(", "&", "EqualsExpression", "{", "binaryExpression", "{", "expression", "{", "}", ",", "left", ",", "right", "}", "}", ")", "\n", "}" ]
// Equals constructs an EqualsExpression
[ "Equals", "constructs", "an", "EqualsExpression" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/criteria/expression_equals.go#L18-L20
135,493
fabric8-services/fabric8-wit
log/context.go
extractIdentityID
func extractIdentityID(ctx context.Context) (string, error) { token := goajwt.ContextJWT(ctx) if token == nil { return "", errors.New("Missing token") } id := token.Claims.(jwt.MapClaims)["sub"] if id == nil { return "", errors.New("Missing sub") } return id.(string), nil }
go
func extractIdentityID(ctx context.Context) (string, error) { token := goajwt.ContextJWT(ctx) if token == nil { return "", errors.New("Missing token") } id := token.Claims.(jwt.MapClaims)["sub"] if id == nil { return "", errors.New("Missing sub") } return id.(string), nil }
[ "func", "extractIdentityID", "(", "ctx", "context", ".", "Context", ")", "(", "string", ",", "error", ")", "{", "token", ":=", "goajwt", ".", "ContextJWT", "(", "ctx", ")", "\n", "if", "token", "==", "nil", "{", "return", "\"", "\"", ",", "errors", "...
// extractIdentityID obtains the identity ID out of the authentication context
[ "extractIdentityID", "obtains", "the", "identity", "ID", "out", "of", "the", "authentication", "context" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/log/context.go#L14-L25
135,494
fabric8-services/fabric8-wit
log/context.go
ExtractRequestID
func ExtractRequestID(ctx context.Context) string { reqID := middleware.ContextRequestID(ctx) if reqID == "" { return client.ContextRequestID(ctx) } return reqID }
go
func ExtractRequestID(ctx context.Context) string { reqID := middleware.ContextRequestID(ctx) if reqID == "" { return client.ContextRequestID(ctx) } return reqID }
[ "func", "ExtractRequestID", "(", "ctx", "context", ".", "Context", ")", "string", "{", "reqID", ":=", "middleware", ".", "ContextRequestID", "(", "ctx", ")", "\n", "if", "reqID", "==", "\"", "\"", "{", "return", "client", ".", "ContextRequestID", "(", "ctx...
// ExtractRequestID obtains the request ID either from a goa client or middleware
[ "ExtractRequestID", "obtains", "the", "request", "ID", "either", "from", "a", "goa", "client", "or", "middleware" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/log/context.go#L28-L35
135,495
fabric8-services/fabric8-wit
criteria/iterator.go
IteratePostOrder
func IteratePostOrder(exp Expression, visitorFunction func(exp Expression) bool) { exp.Accept(&postOrderIterator{visitorFunction}) }
go
func IteratePostOrder(exp Expression, visitorFunction func(exp Expression) bool) { exp.Accept(&postOrderIterator{visitorFunction}) }
[ "func", "IteratePostOrder", "(", "exp", "Expression", ",", "visitorFunction", "func", "(", "exp", "Expression", ")", "bool", ")", "{", "exp", ".", "Accept", "(", "&", "postOrderIterator", "{", "visitorFunction", "}", ")", "\n", "}" ]
// IteratePostOrder walks the expression tree in depth-first, left to right // order. The iteration stops if visitorFunction returns false.
[ "IteratePostOrder", "walks", "the", "expression", "tree", "in", "depth", "-", "first", "left", "to", "right", "order", ".", "The", "iteration", "stops", "if", "visitorFunction", "returns", "false", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/criteria/iterator.go#L5-L7
135,496
fabric8-services/fabric8-wit
comment/comment_revision_repository.go
Create
func (r *GormCommentRevisionRepository) Create(ctx context.Context, modifierID uuid.UUID, revisionType RevisionType, c Comment) error { log.Debug(nil, map[string]interface{}{ "modifier_id": modifierID, "revision_type": revisionType, }, "Storing a revision after operation on comment.") tx := r.db revision := &...
go
func (r *GormCommentRevisionRepository) Create(ctx context.Context, modifierID uuid.UUID, revisionType RevisionType, c Comment) error { log.Debug(nil, map[string]interface{}{ "modifier_id": modifierID, "revision_type": revisionType, }, "Storing a revision after operation on comment.") tx := r.db revision := &...
[ "func", "(", "r", "*", "GormCommentRevisionRepository", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "modifierID", "uuid", ".", "UUID", ",", "revisionType", "RevisionType", ",", "c", "Comment", ")", "error", "{", "log", ".", "Debug", "(", "ni...
// Create stores a new revision for the given comment.
[ "Create", "stores", "a", "new", "revision", "for", "the", "given", "comment", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/comment/comment_revision_repository.go#L37-L69
135,497
fabric8-services/fabric8-wit
controller/planner_backlog.go
NewPlannerBacklogController
func NewPlannerBacklogController(service *goa.Service, db application.DB, config PlannerBacklogControllerConfig) *PlannerBacklogController { return &PlannerBacklogController{ Controller: service.NewController("PlannerBacklogController"), db: db, config: config, } }
go
func NewPlannerBacklogController(service *goa.Service, db application.DB, config PlannerBacklogControllerConfig) *PlannerBacklogController { return &PlannerBacklogController{ Controller: service.NewController("PlannerBacklogController"), db: db, config: config, } }
[ "func", "NewPlannerBacklogController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "PlannerBacklogControllerConfig", ")", "*", "PlannerBacklogController", "{", "return", "&", "PlannerBacklogController", "{", "Control...
// NewPlannerBacklogController creates a planner_backlog controller.
[ "NewPlannerBacklogController", "creates", "a", "planner_backlog", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/planner_backlog.go#L32-L38
135,498
fabric8-services/fabric8-wit
controller/planner_backlog.go
generateBacklogExpression
func generateBacklogExpression(ctx context.Context, db application.DB, spaceID uuid.UUID, exp criteria.Expression) (criteria.Expression, error) { notClosed := criteria.Not(criteria.Field(workitem.SystemState), criteria.Literal(workitem.SystemStateClosed)) if exp != nil { exp = criteria.And(exp, notClosed) } else {...
go
func generateBacklogExpression(ctx context.Context, db application.DB, spaceID uuid.UUID, exp criteria.Expression) (criteria.Expression, error) { notClosed := criteria.Not(criteria.Field(workitem.SystemState), criteria.Literal(workitem.SystemStateClosed)) if exp != nil { exp = criteria.And(exp, notClosed) } else {...
[ "func", "generateBacklogExpression", "(", "ctx", "context", ".", "Context", ",", "db", "application", ".", "DB", ",", "spaceID", "uuid", ".", "UUID", ",", "exp", "criteria", ".", "Expression", ")", "(", "criteria", ".", "Expression", ",", "error", ")", "{"...
// generateBacklogExpression creates the expression to query for backlog items
[ "generateBacklogExpression", "creates", "the", "expression", "to", "query", "for", "backlog", "items" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/planner_backlog.go#L79-L128
135,499
fabric8-services/fabric8-wit
controller/users.go
CreateUserAsServiceAccount
func (c *UsersController) CreateUserAsServiceAccount(ctx *app.CreateUserAsServiceAccountUsersContext) error { isSvcAccount, err := isServiceAccount(ctx, serviceNameAuth) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "failed to determine if account is a service account") return jsonap...
go
func (c *UsersController) CreateUserAsServiceAccount(ctx *app.CreateUserAsServiceAccountUsersContext) error { isSvcAccount, err := isServiceAccount(ctx, serviceNameAuth) if err != nil { log.Error(ctx, map[string]interface{}{ "err": err, }, "failed to determine if account is a service account") return jsonap...
[ "func", "(", "c", "*", "UsersController", ")", "CreateUserAsServiceAccount", "(", "ctx", "*", "app", ".", "CreateUserAsServiceAccountUsersContext", ")", "error", "{", "isSvcAccount", ",", "err", ":=", "isServiceAccount", "(", "ctx", ",", "serviceNameAuth", ")", "\...
// CreateUserAsServiceAccount updates a user when requested using a service account token
[ "CreateUserAsServiceAccount", "updates", "a", "user", "when", "requested", "using", "a", "service", "account", "token" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/users.go#L252-L270