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
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
13,300
fabric8-services/fabric8-wit
remoteworkitem/github.go
Fetch
func (g *GithubTracker) Fetch(githubAuthToken string) chan TrackerItemContent { f := githubIssueFetcher{} ts := oauth2.StaticTokenSource( &oauth2.Token{AccessToken: githubAuthToken}, ) tc := oauth2.NewClient(oauth2.NoContext, ts) f.client = github.NewClient(tc) return g.fetch(&f) }
go
func (g *GithubTracker) Fetch(githubAuthToken string) chan TrackerItemContent { f := githubIssueFetcher{} ts := oauth2.StaticTokenSource( &oauth2.Token{AccessToken: githubAuthToken}, ) tc := oauth2.NewClient(oauth2.NoContext, ts) f.client = github.NewClient(tc) return g.fetch(&f) }
[ "func", "(", "g", "*", "GithubTracker", ")", "Fetch", "(", "githubAuthToken", "string", ")", "chan", "TrackerItemContent", "{", "f", ":=", "githubIssueFetcher", "{", "}", "\n", "ts", ":=", "oauth2", ".", "StaticTokenSource", "(", "&", "oauth2", ".", "Token",...
// Fetch tracker items from Github
[ "Fetch", "tracker", "items", "from", "Github" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/remoteworkitem/github.go#L34-L42
13,301
fabric8-services/fabric8-wit
controller/comments.go
NewCommentsController
func NewCommentsController(service *goa.Service, db application.DB, config CommentsControllerConfiguration) *CommentsController { return NewNotifyingCommentsController(service, db, &notification.DevNullChannel{}, config) }
go
func NewCommentsController(service *goa.Service, db application.DB, config CommentsControllerConfiguration) *CommentsController { return NewNotifyingCommentsController(service, db, &notification.DevNullChannel{}, config) }
[ "func", "NewCommentsController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "CommentsControllerConfiguration", ")", "*", "CommentsController", "{", "return", "NewNotifyingCommentsController", "(", "service", ",", ...
// NewCommentsController creates a comments controller.
[ "NewCommentsController", "creates", "a", "comments", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L44-L46
13,302
fabric8-services/fabric8-wit
controller/comments.go
NewNotifyingCommentsController
func NewNotifyingCommentsController(service *goa.Service, db application.DB, notificationChannel notification.Channel, config CommentsControllerConfiguration) *CommentsController { n := notificationChannel if n == nil { n = &notification.DevNullChannel{} } return &CommentsController{ Controller: service.NewCo...
go
func NewNotifyingCommentsController(service *goa.Service, db application.DB, notificationChannel notification.Channel, config CommentsControllerConfiguration) *CommentsController { n := notificationChannel if n == nil { n = &notification.DevNullChannel{} } return &CommentsController{ Controller: service.NewCo...
[ "func", "NewNotifyingCommentsController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "notificationChannel", "notification", ".", "Channel", ",", "config", "CommentsControllerConfiguration", ")", "*", "CommentsController", "{"...
// NewNotifyingCommentsController creates a comments controller with notification broadcast.
[ "NewNotifyingCommentsController", "creates", "a", "comments", "controller", "with", "notification", "broadcast", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L49-L60
13,303
fabric8-services/fabric8-wit
controller/comments.go
Update
func (c *CommentsController) Update(ctx *app.UpdateCommentsContext) error { identityID, err := login.ContextIdentity(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error())) } cm, wi, userIsCreator, err := c.loadComment(ctx.Context, ctx.CommentID, *identityID) if err != nil { ...
go
func (c *CommentsController) Update(ctx *app.UpdateCommentsContext) error { identityID, err := login.ContextIdentity(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error())) } cm, wi, userIsCreator, err := c.loadComment(ctx.Context, ctx.CommentID, *identityID) if err != nil { ...
[ "func", "(", "c", "*", "CommentsController", ")", "Update", "(", "ctx", "*", "app", ".", "UpdateCommentsContext", ")", "error", "{", "identityID", ",", "err", ":=", "login", ".", "ContextIdentity", "(", "ctx", ")", "\n", "if", "err", "!=", "nil", "{", ...
// Update does PATCH comment
[ "Update", "does", "PATCH", "comment" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L86-L115
13,304
fabric8-services/fabric8-wit
controller/comments.go
Delete
func (c *CommentsController) Delete(ctx *app.DeleteCommentsContext) error { identityID, err := login.ContextIdentity(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error())) } cm, wi, userIsCreator, err := c.loadComment(ctx.Context, ctx.CommentID, *identityID) if err != nil { ...
go
func (c *CommentsController) Delete(ctx *app.DeleteCommentsContext) error { identityID, err := login.ContextIdentity(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error())) } cm, wi, userIsCreator, err := c.loadComment(ctx.Context, ctx.CommentID, *identityID) if err != nil { ...
[ "func", "(", "c", "*", "CommentsController", ")", "Delete", "(", "ctx", "*", "app", ".", "DeleteCommentsContext", ")", "error", "{", "identityID", ",", "err", ":=", "login", ".", "ContextIdentity", "(", "ctx", ")", "\n", "if", "err", "!=", "nil", "{", ...
// Delete does DELETE comment
[ "Delete", "does", "DELETE", "comment" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L147-L173
13,305
fabric8-services/fabric8-wit
controller/comments.go
ConvertComments
func ConvertComments(request *http.Request, comments []comment.Comment, additional ...CommentConvertFunc) []*app.Comment { var cs = []*app.Comment{} for _, c := range comments { cs = append(cs, ConvertComment(request, c, additional...)) } return cs }
go
func ConvertComments(request *http.Request, comments []comment.Comment, additional ...CommentConvertFunc) []*app.Comment { var cs = []*app.Comment{} for _, c := range comments { cs = append(cs, ConvertComment(request, c, additional...)) } return cs }
[ "func", "ConvertComments", "(", "request", "*", "http", ".", "Request", ",", "comments", "[", "]", "comment", ".", "Comment", ",", "additional", "...", "CommentConvertFunc", ")", "[", "]", "*", "app", ".", "Comment", "{", "var", "cs", "=", "[", "]", "*...
// ConvertComments converts between internal and external REST representation
[ "ConvertComments", "converts", "between", "internal", "and", "external", "REST", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L180-L186
13,306
fabric8-services/fabric8-wit
controller/comments.go
ConvertCommentsResourceID
func ConvertCommentsResourceID(request *http.Request, comments []comment.Comment, additional ...CommentConvertFunc) []*app.Comment { var cs = []*app.Comment{} for _, c := range comments { cs = append(cs, ConvertCommentResourceID(request, c, additional...)) } return cs }
go
func ConvertCommentsResourceID(request *http.Request, comments []comment.Comment, additional ...CommentConvertFunc) []*app.Comment { var cs = []*app.Comment{} for _, c := range comments { cs = append(cs, ConvertCommentResourceID(request, c, additional...)) } return cs }
[ "func", "ConvertCommentsResourceID", "(", "request", "*", "http", ".", "Request", ",", "comments", "[", "]", "comment", ".", "Comment", ",", "additional", "...", "CommentConvertFunc", ")", "[", "]", "*", "app", ".", "Comment", "{", "var", "cs", "=", "[", ...
// ConvertCommentsResourceID converts between internal and external REST representation, ResourceIdentificationObject only
[ "ConvertCommentsResourceID", "converts", "between", "internal", "and", "external", "REST", "representation", "ResourceIdentificationObject", "only" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L189-L195
13,307
fabric8-services/fabric8-wit
controller/comments.go
ConvertCommentResourceID
func ConvertCommentResourceID(request *http.Request, comment comment.Comment, additional ...CommentConvertFunc) *app.Comment { c := &app.Comment{ Type: APIStringTypeComments, ID: &comment.ID, } for _, add := range additional { add(request, &comment, c) } return c }
go
func ConvertCommentResourceID(request *http.Request, comment comment.Comment, additional ...CommentConvertFunc) *app.Comment { c := &app.Comment{ Type: APIStringTypeComments, ID: &comment.ID, } for _, add := range additional { add(request, &comment, c) } return c }
[ "func", "ConvertCommentResourceID", "(", "request", "*", "http", ".", "Request", ",", "comment", "comment", ".", "Comment", ",", "additional", "...", "CommentConvertFunc", ")", "*", "app", ".", "Comment", "{", "c", ":=", "&", "app", ".", "Comment", "{", "T...
// ConvertCommentResourceID converts between internal and external REST representation, ResourceIdentificationObject only
[ "ConvertCommentResourceID", "converts", "between", "internal", "and", "external", "REST", "representation", "ResourceIdentificationObject", "only" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L198-L207
13,308
fabric8-services/fabric8-wit
controller/comments.go
ConvertComment
func ConvertComment(request *http.Request, comment comment.Comment, additional ...CommentConvertFunc) *app.Comment { relatedURL := rest.AbsoluteURL(request, app.CommentsHref(comment.ID)) relatedCreatorLink := rest.AbsoluteURL(request, fmt.Sprintf("%s/%s", usersEndpoint, comment.Creator)) c := &app.Comment{ Type: A...
go
func ConvertComment(request *http.Request, comment comment.Comment, additional ...CommentConvertFunc) *app.Comment { relatedURL := rest.AbsoluteURL(request, app.CommentsHref(comment.ID)) relatedCreatorLink := rest.AbsoluteURL(request, fmt.Sprintf("%s/%s", usersEndpoint, comment.Creator)) c := &app.Comment{ Type: A...
[ "func", "ConvertComment", "(", "request", "*", "http", ".", "Request", ",", "comment", "comment", ".", "Comment", ",", "additional", "...", "CommentConvertFunc", ")", "*", "app", ".", "Comment", "{", "relatedURL", ":=", "rest", ".", "AbsoluteURL", "(", "requ...
// ConvertComment converts between internal and external REST representation
[ "ConvertComment", "converts", "between", "internal", "and", "external", "REST", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L210-L260
13,309
fabric8-services/fabric8-wit
controller/comments.go
CommentIncludeParentWorkItem
func CommentIncludeParentWorkItem(ctx context.Context, c *comment.Comment) CommentConvertFunc { return func(request *http.Request, comment *comment.Comment, data *app.Comment) { HrefFunc := func(obj interface{}) string { return fmt.Sprintf(app.WorkitemHref("%v"), obj) } CommentIncludeParent(request, comment, ...
go
func CommentIncludeParentWorkItem(ctx context.Context, c *comment.Comment) CommentConvertFunc { return func(request *http.Request, comment *comment.Comment, data *app.Comment) { HrefFunc := func(obj interface{}) string { return fmt.Sprintf(app.WorkitemHref("%v"), obj) } CommentIncludeParent(request, comment, ...
[ "func", "CommentIncludeParentWorkItem", "(", "ctx", "context", ".", "Context", ",", "c", "*", "comment", ".", "Comment", ")", "CommentConvertFunc", "{", "return", "func", "(", "request", "*", "http", ".", "Request", ",", "comment", "*", "comment", ".", "Comm...
// CommentIncludeParentWorkItem includes a "parent" relation to a WorkItem
[ "CommentIncludeParentWorkItem", "includes", "a", "parent", "relation", "to", "a", "WorkItem" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L266-L273
13,310
fabric8-services/fabric8-wit
controller/comments.go
CommentIncludeParent
func CommentIncludeParent(request *http.Request, comment *comment.Comment, data *app.Comment, href HrefFunc, parentType string) { data.Relationships.Parent = &app.RelationGeneric{ Data: &app.GenericData{ Type: &parentType, ID: ptr.String(comment.ParentID.String()), }, Links: &app.GenericLinks{ Self: p...
go
func CommentIncludeParent(request *http.Request, comment *comment.Comment, data *app.Comment, href HrefFunc, parentType string) { data.Relationships.Parent = &app.RelationGeneric{ Data: &app.GenericData{ Type: &parentType, ID: ptr.String(comment.ParentID.String()), }, Links: &app.GenericLinks{ Self: p...
[ "func", "CommentIncludeParent", "(", "request", "*", "http", ".", "Request", ",", "comment", "*", "comment", ".", "Comment", ",", "data", "*", "app", ".", "Comment", ",", "href", "HrefFunc", ",", "parentType", "string", ")", "{", "data", ".", "Relationship...
// CommentIncludeParent adds the "parent" relationship to this Comment
[ "CommentIncludeParent", "adds", "the", "parent", "relationship", "to", "this", "Comment" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/comments.go#L276-L286
13,311
fabric8-services/fabric8-wit
rest/http.go
Do
func (d *HttpClientDoer) Do(ctx context.Context, req *http.Request) (*http.Response, error) { return d.HttpClient.Do(req) }
go
func (d *HttpClientDoer) Do(ctx context.Context, req *http.Request) (*http.Response, error) { return d.HttpClient.Do(req) }
[ "func", "(", "d", "*", "HttpClientDoer", ")", "Do", "(", "ctx", "context", ".", "Context", ",", "req", "*", "http", ".", "Request", ")", "(", "*", "http", ".", "Response", ",", "error", ")", "{", "return", "d", ".", "HttpClient", ".", "Do", "(", ...
// Do overrides Do method of the default goa client Doer. It's needed for mocking http clients in tests.
[ "Do", "overrides", "Do", "method", "of", "the", "default", "goa", "client", "Doer", ".", "It", "s", "needed", "for", "mocking", "http", "clients", "in", "tests", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/rest/http.go#L31-L33
13,312
fabric8-services/fabric8-wit
controller/user.go
ListSpaces
func (c *UserController) ListSpaces(ctx *app.ListSpacesUserContext) error { client, err := newAuthClient(ctx, c.config, c.httpOptions...) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } res, err := client.ListResourcesUser(goasupport.ForwardContextRequestID(ctx), authservice.ListResourcesUserPath(), ...
go
func (c *UserController) ListSpaces(ctx *app.ListSpacesUserContext) error { client, err := newAuthClient(ctx, c.config, c.httpOptions...) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } res, err := client.ListResourcesUser(goasupport.ForwardContextRequestID(ctx), authservice.ListResourcesUserPath(), ...
[ "func", "(", "c", "*", "UserController", ")", "ListSpaces", "(", "ctx", "*", "app", ".", "ListSpacesUserContext", ")", "error", "{", "client", ",", "err", ":=", "newAuthClient", "(", "ctx", ",", "c", ".", "config", ",", "c", ".", "httpOptions", "...", ...
// ListSpaces returns the list of spaces in which the user has a role
[ "ListSpaces", "returns", "the", "list", "of", "spaces", "in", "which", "the", "user", "has", "a", "role" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/user.go#L118-L156
13,313
fabric8-services/fabric8-wit
spacetemplate/template.go
Equal
func (s SpaceTemplate) Equal(u convert.Equaler) bool { other, ok := u.(SpaceTemplate) if !ok { return false } if !uuid.Equal(s.ID, other.ID) { return false } if s.Name != other.Name { return false } if s.Version != other.Version { return false } if !convert.CascadeEqual(s.Lifecycle, other.Lifecycle) {...
go
func (s SpaceTemplate) Equal(u convert.Equaler) bool { other, ok := u.(SpaceTemplate) if !ok { return false } if !uuid.Equal(s.ID, other.ID) { return false } if s.Name != other.Name { return false } if s.Version != other.Version { return false } if !convert.CascadeEqual(s.Lifecycle, other.Lifecycle) {...
[ "func", "(", "s", "SpaceTemplate", ")", "Equal", "(", "u", "convert", ".", "Equaler", ")", "bool", "{", "other", ",", "ok", ":=", "u", ".", "(", "SpaceTemplate", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n", "if", "!", "uui...
// Equal returns true if two SpaceTemplate objects are equal; otherwise false is // returned.
[ "Equal", "returns", "true", "if", "two", "SpaceTemplate", "objects", "are", "equal", ";", "otherwise", "false", "is", "returned", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/template.go#L69-L93
13,314
fabric8-services/fabric8-wit
errors/errors.go
FromStatusCode
func FromStatusCode(statusCode int, format string, args ...interface{}) error { msg := fmt.Sprintf(format, args...) switch statusCode { case http.StatusNotFound: return NewNotFoundErrorFromString(msg) case http.StatusBadRequest: return NewBadParameterErrorFromString(msg) case http.StatusConflict: return NewV...
go
func FromStatusCode(statusCode int, format string, args ...interface{}) error { msg := fmt.Sprintf(format, args...) switch statusCode { case http.StatusNotFound: return NewNotFoundErrorFromString(msg) case http.StatusBadRequest: return NewBadParameterErrorFromString(msg) case http.StatusConflict: return NewV...
[ "func", "FromStatusCode", "(", "statusCode", "int", ",", "format", "string", ",", "args", "...", "interface", "{", "}", ")", "error", "{", "msg", ":=", "fmt", ".", "Sprintf", "(", "format", ",", "args", "...", ")", "\n", "switch", "statusCode", "{", "c...
// FromStatusCode returns an error from the given HTTP status code, using the message and args
[ "FromStatusCode", "returns", "an", "error", "from", "the", "given", "HTTP", "status", "code", "using", "the", "message", "and", "args" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L25-L41
13,315
fabric8-services/fabric8-wit
errors/errors.go
IsInternalError
func IsInternalError(err error) (bool, error) { e, ok := errs.Cause(err).(InternalError) if !ok { return false, nil } return true, e }
go
func IsInternalError(err error) (bool, error) { e, ok := errs.Cause(err).(InternalError) if !ok { return false, nil } return true, e }
[ "func", "IsInternalError", "(", "err", "error", ")", "(", "bool", ",", "error", ")", "{", "e", ",", "ok", ":=", "errs", ".", "Cause", "(", "err", ")", ".", "(", "InternalError", ")", "\n", "if", "!", "ok", "{", "return", "false", ",", "nil", "\n"...
// IsInternalError returns true if the cause of the given error can be // converted to an InternalError, which is returned as the second result.
[ "IsInternalError", "returns", "true", "if", "the", "cause", "of", "the", "given", "error", "can", "be", "converted", "to", "an", "InternalError", "which", "is", "returned", "as", "the", "second", "result", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L63-L69
13,316
fabric8-services/fabric8-wit
errors/errors.go
IsUnauthorizedError
func IsUnauthorizedError(err error) (bool, error) { e, ok := errs.Cause(err).(UnauthorizedError) if !ok { return false, nil } return true, e }
go
func IsUnauthorizedError(err error) (bool, error) { e, ok := errs.Cause(err).(UnauthorizedError) if !ok { return false, nil } return true, e }
[ "func", "IsUnauthorizedError", "(", "err", "error", ")", "(", "bool", ",", "error", ")", "{", "e", ",", "ok", ":=", "errs", ".", "Cause", "(", "err", ")", ".", "(", "UnauthorizedError", ")", "\n", "if", "!", "ok", "{", "return", "false", ",", "nil"...
// IsUnauthorizedError returns true if the cause of the given error can be // converted to an UnauthorizedError, which is returned as the second result.
[ "IsUnauthorizedError", "returns", "true", "if", "the", "cause", "of", "the", "given", "error", "can", "be", "converted", "to", "an", "UnauthorizedError", "which", "is", "returned", "as", "the", "second", "result", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L78-L84
13,317
fabric8-services/fabric8-wit
errors/errors.go
IsForbiddenError
func IsForbiddenError(err error) (bool, error) { e, ok := errs.Cause(err).(ForbiddenError) if !ok { return false, nil } return true, e }
go
func IsForbiddenError(err error) (bool, error) { e, ok := errs.Cause(err).(ForbiddenError) if !ok { return false, nil } return true, e }
[ "func", "IsForbiddenError", "(", "err", "error", ")", "(", "bool", ",", "error", ")", "{", "e", ",", "ok", ":=", "errs", ".", "Cause", "(", "err", ")", ".", "(", "ForbiddenError", ")", "\n", "if", "!", "ok", "{", "return", "false", ",", "nil", "\...
// IsForbiddenError returns true if the cause of the given error can be // converted to an ForbiddenError, which is returned as the second result.
[ "IsForbiddenError", "returns", "true", "if", "the", "cause", "of", "the", "given", "error", "can", "be", "converted", "to", "an", "ForbiddenError", "which", "is", "returned", "as", "the", "second", "result", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L93-L99
13,318
fabric8-services/fabric8-wit
errors/errors.go
IsDataConflictError
func IsDataConflictError(err error) (bool, error) { e, ok := errs.Cause(err).(DataConflictError) if !ok { return false, nil } return true, e }
go
func IsDataConflictError(err error) (bool, error) { e, ok := errs.Cause(err).(DataConflictError) if !ok { return false, nil } return true, e }
[ "func", "IsDataConflictError", "(", "err", "error", ")", "(", "bool", ",", "error", ")", "{", "e", ",", "ok", ":=", "errs", ".", "Cause", "(", "err", ")", ".", "(", "DataConflictError", ")", "\n", "if", "!", "ok", "{", "return", "false", ",", "nil"...
// IsDataConflictError returns true if the cause of the given error can be // converted to an IsDataConflictError, which is returned as the second result.
[ "IsDataConflictError", "returns", "true", "if", "the", "cause", "of", "the", "given", "error", "can", "be", "converted", "to", "an", "IsDataConflictError", "which", "is", "returned", "as", "the", "second", "result", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L137-L143
13,319
fabric8-services/fabric8-wit
errors/errors.go
IsVersionConflictError
func IsVersionConflictError(err error) (bool, error) { e, ok := errs.Cause(err).(VersionConflictError) if !ok { return false, nil } return true, e }
go
func IsVersionConflictError(err error) (bool, error) { e, ok := errs.Cause(err).(VersionConflictError) if !ok { return false, nil } return true, e }
[ "func", "IsVersionConflictError", "(", "err", "error", ")", "(", "bool", ",", "error", ")", "{", "e", ",", "ok", ":=", "errs", ".", "Cause", "(", "err", ")", ".", "(", "VersionConflictError", ")", "\n", "if", "!", "ok", "{", "return", "false", ",", ...
// IsVersionConflictError returns true if the cause of the given error can be // converted to an VersionConflictError, which is returned as the second result.
[ "IsVersionConflictError", "returns", "true", "if", "the", "cause", "of", "the", "given", "error", "can", "be", "converted", "to", "an", "VersionConflictError", "which", "is", "returned", "as", "the", "second", "result", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L152-L158
13,320
fabric8-services/fabric8-wit
errors/errors.go
NewBadParameterError
func NewBadParameterError(param string, actual interface{}) BadParameterError { return BadParameterError{parameter: param, value: actual} }
go
func NewBadParameterError(param string, actual interface{}) BadParameterError { return BadParameterError{parameter: param, value: actual} }
[ "func", "NewBadParameterError", "(", "param", "string", ",", "actual", "interface", "{", "}", ")", "BadParameterError", "{", "return", "BadParameterError", "{", "parameter", ":", "param", ",", "value", ":", "actual", "}", "\n", "}" ]
// NewBadParameterError returns the custom defined error of type NewBadParameterError.
[ "NewBadParameterError", "returns", "the", "custom", "defined", "error", "of", "type", "NewBadParameterError", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L189-L191
13,321
fabric8-services/fabric8-wit
errors/errors.go
IsBadParameterError
func IsBadParameterError(err error) (bool, error) { e, ok := errs.Cause(err).(BadParameterError) if !ok { return false, nil } return true, e }
go
func IsBadParameterError(err error) (bool, error) { e, ok := errs.Cause(err).(BadParameterError) if !ok { return false, nil } return true, e }
[ "func", "IsBadParameterError", "(", "err", "error", ")", "(", "bool", ",", "error", ")", "{", "e", ",", "ok", ":=", "errs", ".", "Cause", "(", "err", ")", ".", "(", "BadParameterError", ")", "\n", "if", "!", "ok", "{", "return", "false", ",", "nil"...
// IsBadParameterError returns true if the cause of the given error can be // converted to an BadParameterError, which is returned as the second result.
[ "IsBadParameterError", "returns", "true", "if", "the", "cause", "of", "the", "given", "error", "can", "be", "converted", "to", "an", "BadParameterError", "which", "is", "returned", "as", "the", "second", "result", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L200-L206
13,322
fabric8-services/fabric8-wit
errors/errors.go
IsConversionError
func IsConversionError(err error) (bool, error) { e, ok := errs.Cause(err).(ConversionError) if !ok { return false, nil } return true, e }
go
func IsConversionError(err error) (bool, error) { e, ok := errs.Cause(err).(ConversionError) if !ok { return false, nil } return true, e }
[ "func", "IsConversionError", "(", "err", "error", ")", "(", "bool", ",", "error", ")", "{", "e", ",", "ok", ":=", "errs", ".", "Cause", "(", "err", ")", ".", "(", "ConversionError", ")", "\n", "if", "!", "ok", "{", "return", "false", ",", "nil", ...
// IsConversionError returns true if the cause of the given error can be // converted to an ConversionError, which is returned as the second result.
[ "IsConversionError", "returns", "true", "if", "the", "cause", "of", "the", "given", "error", "can", "be", "converted", "to", "an", "ConversionError", "which", "is", "returned", "as", "the", "second", "result", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L215-L221
13,323
fabric8-services/fabric8-wit
errors/errors.go
IsNotFoundError
func IsNotFoundError(err error) (bool, error) { e, ok := errs.Cause(err).(NotFoundError) if !ok { return false, nil } return true, e }
go
func IsNotFoundError(err error) (bool, error) { e, ok := errs.Cause(err).(NotFoundError) if !ok { return false, nil } return true, e }
[ "func", "IsNotFoundError", "(", "err", "error", ")", "(", "bool", ",", "error", ")", "{", "e", ",", "ok", ":=", "errs", ".", "Cause", "(", "err", ")", ".", "(", "NotFoundError", ")", "\n", "if", "!", "ok", "{", "return", "false", ",", "nil", "\n"...
// IsNotFoundError returns true if the cause of the given error can be // converted to an NotFoundError, which is returned as the second result.
[ "IsNotFoundError", "returns", "true", "if", "the", "cause", "of", "the", "given", "error", "can", "be", "converted", "to", "an", "NotFoundError", "which", "is", "returned", "as", "the", "second", "result", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/errors/errors.go#L254-L260
13,324
fabric8-services/fabric8-wit
account/context_information.go
Equal
func (f ContextInformation) Equal(u convert.Equaler) bool { other, ok := u.(ContextInformation) if !ok { return false } return reflect.DeepEqual(f, other) }
go
func (f ContextInformation) Equal(u convert.Equaler) bool { other, ok := u.(ContextInformation) if !ok { return false } return reflect.DeepEqual(f, other) }
[ "func", "(", "f", "ContextInformation", ")", "Equal", "(", "u", "convert", ".", "Equaler", ")", "bool", "{", "other", ",", "ok", ":=", "u", ".", "(", "ContextInformation", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n", "return",...
// Equal returns true if two ContextInformation objects are equal; otherwise false is returned.
[ "Equal", "returns", "true", "if", "two", "ContextInformation", "objects", "are", "equal", ";", "otherwise", "false", "is", "returned", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/account/context_information.go#L20-L26
13,325
fabric8-services/fabric8-wit
controller/work_item_link.go
NewWorkItemLinkController
func NewWorkItemLinkController(service *goa.Service, db application.DB, config WorkItemLinkControllerConfig) *WorkItemLinkController { return &WorkItemLinkController{ Controller: service.NewController("WorkItemLinkController"), db: db, config: config, } }
go
func NewWorkItemLinkController(service *goa.Service, db application.DB, config WorkItemLinkControllerConfig) *WorkItemLinkController { return &WorkItemLinkController{ Controller: service.NewController("WorkItemLinkController"), db: db, config: config, } }
[ "func", "NewWorkItemLinkController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "WorkItemLinkControllerConfig", ")", "*", "WorkItemLinkController", "{", "return", "&", "WorkItemLinkController", "{", "Controller", ...
// NewWorkItemLinkController creates a work-item-link controller.
[ "NewWorkItemLinkController", "creates", "a", "work", "-", "item", "-", "link", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_link.go#L35-L41
13,326
fabric8-services/fabric8-wit
controller/work_item_link.go
newWorkItemLinkContext
func newWorkItemLinkContext(ctx context.Context, service *goa.Service, appl application.Application, db application.DB, request *http.Request, responseWriter http.ResponseWriter, linkFunc hrefLinkFunc, currentUserIdentityID *uuid.UUID) *workItemLinkContext { return &workItemLinkContext{ Request: reques...
go
func newWorkItemLinkContext(ctx context.Context, service *goa.Service, appl application.Application, db application.DB, request *http.Request, responseWriter http.ResponseWriter, linkFunc hrefLinkFunc, currentUserIdentityID *uuid.UUID) *workItemLinkContext { return &workItemLinkContext{ Request: reques...
[ "func", "newWorkItemLinkContext", "(", "ctx", "context", ".", "Context", ",", "service", "*", "goa", ".", "Service", ",", "appl", "application", ".", "Application", ",", "db", "application", ".", "DB", ",", "request", "*", "http", ".", "Request", ",", "res...
// newWorkItemLinkContext returns a new workItemLinkContext
[ "newWorkItemLinkContext", "returns", "a", "new", "workItemLinkContext" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_link.go#L63-L74
13,327
fabric8-services/fabric8-wit
controller/work_item_link.go
getTypesOfLinks
func getTypesOfLinks(ctx context.Context, appl application.Application, req *http.Request, linksDataArr []*app.WorkItemLinkData) ([]*app.WorkItemLinkTypeData, error) { // Build our "set" of distinct type IDs idMap := map[uuid.UUID]struct{}{} idArr := []uuid.UUID{} for _, linkData := range linksDataArr { id := lin...
go
func getTypesOfLinks(ctx context.Context, appl application.Application, req *http.Request, linksDataArr []*app.WorkItemLinkData) ([]*app.WorkItemLinkTypeData, error) { // Build our "set" of distinct type IDs idMap := map[uuid.UUID]struct{}{} idArr := []uuid.UUID{} for _, linkData := range linksDataArr { id := lin...
[ "func", "getTypesOfLinks", "(", "ctx", "context", ".", "Context", ",", "appl", "application", ".", "Application", ",", "req", "*", "http", ".", "Request", ",", "linksDataArr", "[", "]", "*", "app", ".", "WorkItemLinkData", ")", "(", "[", "]", "*", "app",...
// getTypesOfLinks returns an array of distinct work item link types for the // given work item links
[ "getTypesOfLinks", "returns", "an", "array", "of", "distinct", "work", "item", "link", "types", "for", "the", "given", "work", "item", "links" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_link.go#L78-L104
13,328
fabric8-services/fabric8-wit
controller/work_item_link.go
getWorkItemsOfLinks
func getWorkItemsOfLinks(ctx context.Context, appl application.Application, req *http.Request, linksDataArr []*app.WorkItemLinkData) ([]*app.WorkItem, error) { // Build our "set" of distinct work item IDs idMap := map[uuid.UUID]struct{}{} idArr := []uuid.UUID{} for _, linkData := range linksDataArr { src := linkD...
go
func getWorkItemsOfLinks(ctx context.Context, appl application.Application, req *http.Request, linksDataArr []*app.WorkItemLinkData) ([]*app.WorkItem, error) { // Build our "set" of distinct work item IDs idMap := map[uuid.UUID]struct{}{} idArr := []uuid.UUID{} for _, linkData := range linksDataArr { src := linkD...
[ "func", "getWorkItemsOfLinks", "(", "ctx", "context", ".", "Context", ",", "appl", "application", ".", "Application", ",", "req", "*", "http", ".", "Request", ",", "linksDataArr", "[", "]", "*", "app", ".", "WorkItemLinkData", ")", "(", "[", "]", "*", "a...
// getWorkItemsOfLinks returns an array of distinct work items as they appear as // source or target in the given work item links.
[ "getWorkItemsOfLinks", "returns", "an", "array", "of", "distinct", "work", "items", "as", "they", "appear", "as", "source", "or", "target", "in", "the", "given", "work", "item", "links", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_link.go#L108-L143
13,329
fabric8-services/fabric8-wit
controller/work_item_link.go
enrichLinkSingle
func enrichLinkSingle(ctx context.Context, appl application.Application, req *http.Request, appLinks *app.WorkItemLinkSingle) error { // Include link type //modelLinkType, err := ctx.Application.WorkItemLinkTypes().Load(ctx.Context, appLinks.Data.Relationships.LinkType.Data.ID) modelLinkType, err := appl.WorkItemLin...
go
func enrichLinkSingle(ctx context.Context, appl application.Application, req *http.Request, appLinks *app.WorkItemLinkSingle) error { // Include link type //modelLinkType, err := ctx.Application.WorkItemLinkTypes().Load(ctx.Context, appLinks.Data.Relationships.LinkType.Data.ID) modelLinkType, err := appl.WorkItemLin...
[ "func", "enrichLinkSingle", "(", "ctx", "context", ".", "Context", ",", "appl", "application", ".", "Application", ",", "req", "*", "http", ".", "Request", ",", "appLinks", "*", "app", ".", "WorkItemLinkSingle", ")", "error", "{", "// Include link type", "//mo...
// enrichLinkSingle includes related resources in the link's "included" array
[ "enrichLinkSingle", "includes", "related", "resources", "in", "the", "link", "s", "included", "array" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_link.go#L146-L186
13,330
fabric8-services/fabric8-wit
controller/work_item_link.go
enrichLinkList
func enrichLinkList(ctx context.Context, appl application.Application, req *http.Request, linkArr *app.WorkItemLinkList) error { // include link types typeDataArr, err := getTypesOfLinks(ctx, appl, req, linkArr.Data) if err != nil { return errs.WithStack(err) } // Convert slice of objects to slice of interface (...
go
func enrichLinkList(ctx context.Context, appl application.Application, req *http.Request, linkArr *app.WorkItemLinkList) error { // include link types typeDataArr, err := getTypesOfLinks(ctx, appl, req, linkArr.Data) if err != nil { return errs.WithStack(err) } // Convert slice of objects to slice of interface (...
[ "func", "enrichLinkList", "(", "ctx", "context", ".", "Context", ",", "appl", "application", ".", "Application", ",", "req", "*", "http", ".", "Request", ",", "linkArr", "*", "app", ".", "WorkItemLinkList", ")", "error", "{", "// include link types", "typeData...
// enrichLinkList includes related resources in the linkArr's "included" element
[ "enrichLinkList", "includes", "related", "resources", "in", "the", "linkArr", "s", "included", "element" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_link.go#L189-L214
13,331
fabric8-services/fabric8-wit
controller/work_item_link.go
Delete
func (c *WorkItemLinkController) Delete(ctx *app.DeleteWorkItemLinkContext) error { currentUserIdentityID, err := login.ContextIdentity(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError(err.Error())) } authorized, err := c.checkIfUserIsSpaceCollaboratorOrWorkItemCreator(ctx, c...
go
func (c *WorkItemLinkController) Delete(ctx *app.DeleteWorkItemLinkContext) error { currentUserIdentityID, err := login.ContextIdentity(ctx) if err != nil { return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError(err.Error())) } authorized, err := c.checkIfUserIsSpaceCollaboratorOrWorkItemCreator(ctx, c...
[ "func", "(", "c", "*", "WorkItemLinkController", ")", "Delete", "(", "ctx", "*", "app", ".", "DeleteWorkItemLinkContext", ")", "error", "{", "currentUserIdentityID", ",", "err", ":=", "login", ".", "ContextIdentity", "(", "ctx", ")", "\n", "if", "err", "!=",...
// // Delete runs the delete action
[ "Delete", "runs", "the", "delete", "action" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_link.go#L310-L329
13,332
fabric8-services/fabric8-wit
controller/work_item_link.go
ConvertLinkFromModel
func ConvertLinkFromModel(request *http.Request, t link.WorkItemLink) app.WorkItemLinkSingle { linkSelfURL := rest.AbsoluteURL(request, app.WorkItemLinkHref(t.ID.String())) linkTypeRelatedURL := rest.AbsoluteURL(request, app.WorkItemLinkTypeHref(t.LinkTypeID.String())) sourceRelatedURL := rest.AbsoluteURL(request, ...
go
func ConvertLinkFromModel(request *http.Request, t link.WorkItemLink) app.WorkItemLinkSingle { linkSelfURL := rest.AbsoluteURL(request, app.WorkItemLinkHref(t.ID.String())) linkTypeRelatedURL := rest.AbsoluteURL(request, app.WorkItemLinkTypeHref(t.LinkTypeID.String())) sourceRelatedURL := rest.AbsoluteURL(request, ...
[ "func", "ConvertLinkFromModel", "(", "request", "*", "http", ".", "Request", ",", "t", "link", ".", "WorkItemLink", ")", "app", ".", "WorkItemLinkSingle", "{", "linkSelfURL", ":=", "rest", ".", "AbsoluteURL", "(", "request", ",", "app", ".", "WorkItemLinkHref"...
// ConvertLinkFromModel converts a work item from model to REST representation
[ "ConvertLinkFromModel", "converts", "a", "work", "item", "from", "model", "to", "REST", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_link.go#L353-L404
13,333
fabric8-services/fabric8-wit
controller/workitemtype.go
NewWorkitemtypeController
func NewWorkitemtypeController(service *goa.Service, db application.DB, config workItemTypeControllerConfiguration) *WorkitemtypeController { return &WorkitemtypeController{ Controller: service.NewController("WorkitemtypeController"), db: db, config: config, } }
go
func NewWorkitemtypeController(service *goa.Service, db application.DB, config workItemTypeControllerConfiguration) *WorkitemtypeController { return &WorkitemtypeController{ Controller: service.NewController("WorkitemtypeController"), db: db, config: config, } }
[ "func", "NewWorkitemtypeController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "workItemTypeControllerConfiguration", ")", "*", "WorkitemtypeController", "{", "return", "&", "WorkitemtypeController", "{", "Controll...
// NewWorkitemtypeController creates a workitemtype controller.
[ "NewWorkitemtypeController", "creates", "a", "workitemtype", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/workitemtype.go#L31-L37
13,334
fabric8-services/fabric8-wit
controller/workitemtype.go
ConvertWorkItemTypeFromModel
func ConvertWorkItemTypeFromModel(request *http.Request, t *workitem.WorkItemType) app.WorkItemTypeData { spaceTemplateRelatedURL := rest.AbsoluteURL(request, app.SpaceTemplateHref(t.SpaceTemplateID.String())) spaceRelatedURL := rest.AbsoluteURL(request, app.SpaceHref(space.SystemSpace.String())) var converted = app...
go
func ConvertWorkItemTypeFromModel(request *http.Request, t *workitem.WorkItemType) app.WorkItemTypeData { spaceTemplateRelatedURL := rest.AbsoluteURL(request, app.SpaceTemplateHref(t.SpaceTemplateID.String())) spaceRelatedURL := rest.AbsoluteURL(request, app.SpaceHref(space.SystemSpace.String())) var converted = app...
[ "func", "ConvertWorkItemTypeFromModel", "(", "request", "*", "http", ".", "Request", ",", "t", "*", "workitem", ".", "WorkItemType", ")", "app", ".", "WorkItemTypeData", "{", "spaceTemplateRelatedURL", ":=", "rest", ".", "AbsoluteURL", "(", "request", ",", "app"...
// ConvertWorkItemTypeFromModel converts from models to app representation
[ "ConvertWorkItemTypeFromModel", "converts", "from", "models", "to", "app", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/workitemtype.go#L59-L102
13,335
fabric8-services/fabric8-wit
controller/workitemtype.go
ConvertFieldTypeFromModel
func ConvertFieldTypeFromModel(t workitem.FieldType) app.FieldType { result := app.FieldType{} result.Kind = string(t.GetKind()) switch modelFieldType := t.(type) { case workitem.ListType: result.ComponentType = ptr.String(string(modelFieldType.ComponentType.GetKind())) if modelFieldType.DefaultValue != nil { ...
go
func ConvertFieldTypeFromModel(t workitem.FieldType) app.FieldType { result := app.FieldType{} result.Kind = string(t.GetKind()) switch modelFieldType := t.(type) { case workitem.ListType: result.ComponentType = ptr.String(string(modelFieldType.ComponentType.GetKind())) if modelFieldType.DefaultValue != nil { ...
[ "func", "ConvertFieldTypeFromModel", "(", "t", "workitem", ".", "FieldType", ")", "app", ".", "FieldType", "{", "result", ":=", "app", ".", "FieldType", "{", "}", "\n", "result", ".", "Kind", "=", "string", "(", "t", ".", "GetKind", "(", ")", ")", "\n"...
// converts the field type from model to app representation
[ "converts", "the", "field", "type", "from", "model", "to", "app", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/workitemtype.go#L105-L127
13,336
fabric8-services/fabric8-wit
area/area.go
MakeChildOf
func (m *Area) MakeChildOf(parent Area) { if m.ID == uuid.Nil { m.ID = uuid.NewV4() } m.Path = append(parent.Path, m.ID) }
go
func (m *Area) MakeChildOf(parent Area) { if m.ID == uuid.Nil { m.ID = uuid.NewV4() } m.Path = append(parent.Path, m.ID) }
[ "func", "(", "m", "*", "Area", ")", "MakeChildOf", "(", "parent", "Area", ")", "{", "if", "m", ".", "ID", "==", "uuid", ".", "Nil", "{", "m", ".", "ID", "=", "uuid", ".", "NewV4", "(", ")", "\n", "}", "\n", "m", ".", "Path", "=", "append", ...
// MakeChildOf does all the path magic to make the current area a child of the // given parent area.
[ "MakeChildOf", "does", "all", "the", "path", "magic", "to", "make", "the", "current", "area", "a", "child", "of", "the", "given", "parent", "area", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/area/area.go#L37-L42
13,337
fabric8-services/fabric8-wit
area/area.go
LoadMultiple
func (m *GormAreaRepository) LoadMultiple(ctx context.Context, ids []uuid.UUID) ([]Area, error) { defer goa.MeasureSince([]string{"goa", "db", "Area", "getmultiple"}, time.Now()) var objs []Area if len(ids) == 0 { return objs, nil } for i := 0; i < len(ids); i++ { m.db = m.db.Or("id = ?", ids[i]) } tx := m.d...
go
func (m *GormAreaRepository) LoadMultiple(ctx context.Context, ids []uuid.UUID) ([]Area, error) { defer goa.MeasureSince([]string{"goa", "db", "Area", "getmultiple"}, time.Now()) var objs []Area if len(ids) == 0 { return objs, nil } for i := 0; i < len(ids); i++ { m.db = m.db.Or("id = ?", ids[i]) } tx := m.d...
[ "func", "(", "m", "*", "GormAreaRepository", ")", "LoadMultiple", "(", "ctx", "context", ".", "Context", ",", "ids", "[", "]", "uuid", ".", "UUID", ")", "(", "[", "]", "Area", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "...
// Load multiple areas
[ "Load", "multiple", "areas" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/area/area.go#L151-L165
13,338
fabric8-services/fabric8-wit
area/area.go
ListChildren
func (m *GormAreaRepository) ListChildren(ctx context.Context, parentArea *Area) ([]Area, error) { defer goa.MeasureSince([]string{"goa", "db", "Area", "querychild"}, time.Now()) var objs []Area tx := m.db.Where("path ~ ($1 || '.*{1}')::lquery", parentArea.Path.Convert()).Find(&objs) if tx.RecordNotFound() { ret...
go
func (m *GormAreaRepository) ListChildren(ctx context.Context, parentArea *Area) ([]Area, error) { defer goa.MeasureSince([]string{"goa", "db", "Area", "querychild"}, time.Now()) var objs []Area tx := m.db.Where("path ~ ($1 || '.*{1}')::lquery", parentArea.Path.Convert()).Find(&objs) if tx.RecordNotFound() { ret...
[ "func", "(", "m", "*", "GormAreaRepository", ")", "ListChildren", "(", "ctx", "context", ".", "Context", ",", "parentArea", "*", "Area", ")", "(", "[", "]", "Area", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", ...
// ListChildren fetches all Areas belonging to a parent - list all child areas.
[ "ListChildren", "fetches", "all", "Areas", "belonging", "to", "a", "parent", "-", "list", "all", "child", "areas", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/area/area.go#L168-L180
13,339
fabric8-services/fabric8-wit
area/area.go
Root
func (m *GormAreaRepository) Root(ctx context.Context, spaceID uuid.UUID) (*Area, error) { defer goa.MeasureSince([]string{"goa", "db", "Area", "root"}, time.Now()) var rootArea []Area rootArea, err := m.Query(FilterBySpaceID(spaceID), func(db *gorm.DB) *gorm.DB { return db.Where("space_id = ? AND nlevel(path)=1"...
go
func (m *GormAreaRepository) Root(ctx context.Context, spaceID uuid.UUID) (*Area, error) { defer goa.MeasureSince([]string{"goa", "db", "Area", "root"}, time.Now()) var rootArea []Area rootArea, err := m.Query(FilterBySpaceID(spaceID), func(db *gorm.DB) *gorm.DB { return db.Where("space_id = ? AND nlevel(path)=1"...
[ "func", "(", "m", "*", "GormAreaRepository", ")", "Root", "(", "ctx", "context", ".", "Context", ",", "spaceID", "uuid", ".", "UUID", ")", "(", "*", "Area", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", "{", ...
// Root fetches the Root Areas inside a space.
[ "Root", "fetches", "the", "Root", "Areas", "inside", "a", "space", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/area/area.go#L183-L198
13,340
fabric8-services/fabric8-wit
area/area.go
FilterBySpaceID
func FilterBySpaceID(spaceID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("space_id = ?", spaceID) } }
go
func FilterBySpaceID(spaceID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("space_id = ?", spaceID) } }
[ "func", "FilterBySpaceID", "(", "spaceID", "uuid", ".", "UUID", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "...
// FilterBySpaceID is a gorm filter for a Belongs To relationship.
[ "FilterBySpaceID", "is", "a", "gorm", "filter", "for", "a", "Belongs", "To", "relationship", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/area/area.go#L218-L222
13,341
fabric8-services/fabric8-wit
area/area.go
FilterByName
func FilterByName(name string) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("name = ?", name).Limit(1) } }
go
func FilterByName(name string) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("name = ?", name).Limit(1) } }
[ "func", "FilterByName", "(", "name", "string", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "db", ".", "Where"...
// FilterByName is a gorm filter by 'name'
[ "FilterByName", "is", "a", "gorm", "filter", "by", "name" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/area/area.go#L225-L229
13,342
fabric8-services/fabric8-wit
controller/work_item_labels.go
NewWorkItemLabelsController
func NewWorkItemLabelsController(service *goa.Service, db application.DB, config WorkItemLabelsControllerConfiguration) *WorkItemLabelsController { return &WorkItemLabelsController{ Controller: service.NewController("WorkItemLabelsController"), db: db, config: config, } }
go
func NewWorkItemLabelsController(service *goa.Service, db application.DB, config WorkItemLabelsControllerConfiguration) *WorkItemLabelsController { return &WorkItemLabelsController{ Controller: service.NewController("WorkItemLabelsController"), db: db, config: config, } }
[ "func", "NewWorkItemLabelsController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "WorkItemLabelsControllerConfiguration", ")", "*", "WorkItemLabelsController", "{", "return", "&", "WorkItemLabelsController", "{", "...
// NewWorkItemLabelsController creates a work_item_labels controller.
[ "NewWorkItemLabelsController", "creates", "a", "work_item_labels", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_labels.go#L27-L33
13,343
fabric8-services/fabric8-wit
spacetemplate/importer/import_helper.go
String
func (s ImportHelper) String() string { copy := s bytes, err := yaml.Marshal(copy) if err != nil { log.Info(nil, map[string]interface{}{ "err": err, }, "failed to marshal space template to YAML") return "" } return string(bytes) }
go
func (s ImportHelper) String() string { copy := s bytes, err := yaml.Marshal(copy) if err != nil { log.Info(nil, map[string]interface{}{ "err": err, }, "failed to marshal space template to YAML") return "" } return string(bytes) }
[ "func", "(", "s", "ImportHelper", ")", "String", "(", ")", "string", "{", "copy", ":=", "s", "\n", "bytes", ",", "err", ":=", "yaml", ".", "Marshal", "(", "copy", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Info", "(", "nil", ",", "m...
// String convert a parsed template into a string in YAML format
[ "String", "convert", "a", "parsed", "template", "into", "a", "string", "in", "YAML", "format" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/import_helper.go#L62-L72
13,344
fabric8-services/fabric8-wit
spacetemplate/importer/import_helper.go
FromString
func FromString(templ string) (*ImportHelper, error) { var s ImportHelper if err := yaml.Unmarshal([]byte(templ), &s); err != nil { log.Info(nil, map[string]interface{}{ "template": templ, "err": err, }, "failed to unmarshal YAML space template") return nil, errs.Wrapf(err, "failed to parse YAML spac...
go
func FromString(templ string) (*ImportHelper, error) { var s ImportHelper if err := yaml.Unmarshal([]byte(templ), &s); err != nil { log.Info(nil, map[string]interface{}{ "template": templ, "err": err, }, "failed to unmarshal YAML space template") return nil, errs.Wrapf(err, "failed to parse YAML spac...
[ "func", "FromString", "(", "templ", "string", ")", "(", "*", "ImportHelper", ",", "error", ")", "{", "var", "s", "ImportHelper", "\n", "if", "err", ":=", "yaml", ".", "Unmarshal", "(", "[", "]", "byte", "(", "templ", ")", ",", "&", "s", ")", ";", ...
// FromString parses a given string into a parsed template object and validates // it.
[ "FromString", "parses", "a", "given", "string", "into", "a", "parsed", "template", "object", "and", "validates", "it", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/import_helper.go#L76-L95
13,345
fabric8-services/fabric8-wit
spacetemplate/importer/import_helper.go
SetID
func (s *ImportHelper) SetID(id uuid.UUID) { s.Template.ID = id for _, wit := range s.WITs { wit.SpaceTemplateID = s.Template.ID } for _, wilt := range s.WILTs { wilt.SpaceTemplateID = s.Template.ID } for _, witg := range s.WITGs { witg.SpaceTemplateID = s.Template.ID } for _, wib := range s.WIBs { wib....
go
func (s *ImportHelper) SetID(id uuid.UUID) { s.Template.ID = id for _, wit := range s.WITs { wit.SpaceTemplateID = s.Template.ID } for _, wilt := range s.WILTs { wilt.SpaceTemplateID = s.Template.ID } for _, witg := range s.WITGs { witg.SpaceTemplateID = s.Template.ID } for _, wib := range s.WIBs { wib....
[ "func", "(", "s", "*", "ImportHelper", ")", "SetID", "(", "id", "uuid", ".", "UUID", ")", "{", "s", ".", "Template", ".", "ID", "=", "id", "\n", "for", "_", ",", "wit", ":=", "range", "s", ".", "WITs", "{", "wit", ".", "SpaceTemplateID", "=", "...
// SetID updates the space templates IDs and updates the references to that ID.
[ "SetID", "updates", "the", "space", "templates", "IDs", "and", "updates", "the", "references", "to", "that", "ID", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/import_helper.go#L98-L112
13,346
fabric8-services/fabric8-wit
spacetemplate/importer/import_helper.go
Equal
func (s ImportHelper) Equal(u convert.Equaler) bool { other, ok := u.(ImportHelper) if !ok { return false } // test nested space template on equality if !convert.CascadeEqual(s.Template, other.Template) { return false } if len(s.WITs) != len(other.WITs) { return false } for k := range s.WITs { if other...
go
func (s ImportHelper) Equal(u convert.Equaler) bool { other, ok := u.(ImportHelper) if !ok { return false } // test nested space template on equality if !convert.CascadeEqual(s.Template, other.Template) { return false } if len(s.WITs) != len(other.WITs) { return false } for k := range s.WITs { if other...
[ "func", "(", "s", "ImportHelper", ")", "Equal", "(", "u", "convert", ".", "Equaler", ")", "bool", "{", "other", ",", "ok", ":=", "u", ".", "(", "ImportHelper", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n", "// test nested space...
// Equal returns true if two ImportHelper objects are equal; otherwise false is // returned.
[ "Equal", "returns", "true", "if", "two", "ImportHelper", "objects", "are", "equal", ";", "otherwise", "false", "is", "returned", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/import_helper.go#L120-L174
13,347
fabric8-services/fabric8-wit
spacetemplate/importer/import_helper.go
BaseTemplate
func BaseTemplate() (*ImportHelper, error) { bs, err := spacetemplate.Asset("base.yaml") if err != nil { return nil, errs.Wrap(err, "failed to load base template") } s, err := FromString(string(bs)) if err != nil { return nil, errs.WithStack(err) } s.SetID(spacetemplate.SystemBaseTemplateID) return s, nil }
go
func BaseTemplate() (*ImportHelper, error) { bs, err := spacetemplate.Asset("base.yaml") if err != nil { return nil, errs.Wrap(err, "failed to load base template") } s, err := FromString(string(bs)) if err != nil { return nil, errs.WithStack(err) } s.SetID(spacetemplate.SystemBaseTemplateID) return s, nil }
[ "func", "BaseTemplate", "(", ")", "(", "*", "ImportHelper", ",", "error", ")", "{", "bs", ",", "err", ":=", "spacetemplate", ".", "Asset", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errs", ".", "Wrap", "(", ...
// BaseTemplate returns the base template
[ "BaseTemplate", "returns", "the", "base", "template" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/import_helper.go#L182-L193
13,348
fabric8-services/fabric8-wit
spacetemplate/importer/import_helper.go
LegacyTemplate
func LegacyTemplate() (*ImportHelper, error) { bs, err := spacetemplate.Asset("legacy.yaml") if err != nil { return nil, errs.Wrap(err, "failed to load legacy template") } s, err := FromString(string(bs)) if err != nil { return nil, errs.WithStack(err) } s.SetID(spacetemplate.SystemLegacyTemplateID) return ...
go
func LegacyTemplate() (*ImportHelper, error) { bs, err := spacetemplate.Asset("legacy.yaml") if err != nil { return nil, errs.Wrap(err, "failed to load legacy template") } s, err := FromString(string(bs)) if err != nil { return nil, errs.WithStack(err) } s.SetID(spacetemplate.SystemLegacyTemplateID) return ...
[ "func", "LegacyTemplate", "(", ")", "(", "*", "ImportHelper", ",", "error", ")", "{", "bs", ",", "err", ":=", "spacetemplate", ".", "Asset", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errs", ".", "Wrap", "(", ...
// LegacyTemplate returns the legacy template as it is known to the system
[ "LegacyTemplate", "returns", "the", "legacy", "template", "as", "it", "is", "known", "to", "the", "system" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/import_helper.go#L196-L207
13,349
fabric8-services/fabric8-wit
spacetemplate/importer/import_helper.go
ScrumTemplate
func ScrumTemplate() (*ImportHelper, error) { bs, err := spacetemplate.Asset("scrum.yaml") if err != nil { return nil, errs.Wrap(err, "failed to load scrum template") } s, err := FromString(string(bs)) if err != nil { return nil, errs.WithStack(err) } s.SetID(spacetemplate.SystemScrumTemplateID) return s, n...
go
func ScrumTemplate() (*ImportHelper, error) { bs, err := spacetemplate.Asset("scrum.yaml") if err != nil { return nil, errs.Wrap(err, "failed to load scrum template") } s, err := FromString(string(bs)) if err != nil { return nil, errs.WithStack(err) } s.SetID(spacetemplate.SystemScrumTemplateID) return s, n...
[ "func", "ScrumTemplate", "(", ")", "(", "*", "ImportHelper", ",", "error", ")", "{", "bs", ",", "err", ":=", "spacetemplate", ".", "Asset", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errs", ".", "Wrap", "(", ...
// ScrumTemplate returns the scrum template as it is known to the system
[ "ScrumTemplate", "returns", "the", "scrum", "template", "as", "it", "is", "known", "to", "the", "system" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/import_helper.go#L210-L221
13,350
fabric8-services/fabric8-wit
spacetemplate/importer/import_helper.go
AgileTemplate
func AgileTemplate() (*ImportHelper, error) { bs, err := spacetemplate.Asset("agile.yaml") if err != nil { return nil, errs.Wrap(err, "failed to load agile template") } s, err := FromString(string(bs)) if err != nil { return nil, errs.WithStack(err) } s.SetID(spacetemplate.SystemAgileTemplateID) return s, n...
go
func AgileTemplate() (*ImportHelper, error) { bs, err := spacetemplate.Asset("agile.yaml") if err != nil { return nil, errs.Wrap(err, "failed to load agile template") } s, err := FromString(string(bs)) if err != nil { return nil, errs.WithStack(err) } s.SetID(spacetemplate.SystemAgileTemplateID) return s, n...
[ "func", "AgileTemplate", "(", ")", "(", "*", "ImportHelper", ",", "error", ")", "{", "bs", ",", "err", ":=", "spacetemplate", ".", "Asset", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "errs", ".", "Wrap", "(", ...
// AgileTemplate returns the agile template as it is known to the system
[ "AgileTemplate", "returns", "the", "agile", "template", "as", "it", "is", "known", "to", "the", "system" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/import_helper.go#L224-L235
13,351
fabric8-services/fabric8-wit
controller/space_iterations.go
NewSpaceIterationsController
func NewSpaceIterationsController(service *goa.Service, db application.DB, config SpaceIterationsControllerConfiguration) *SpaceIterationsController { return &SpaceIterationsController{Controller: service.NewController("SpaceIterationsController"), db: db, config: config} }
go
func NewSpaceIterationsController(service *goa.Service, db application.DB, config SpaceIterationsControllerConfiguration) *SpaceIterationsController { return &SpaceIterationsController{Controller: service.NewController("SpaceIterationsController"), db: db, config: config} }
[ "func", "NewSpaceIterationsController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "SpaceIterationsControllerConfiguration", ")", "*", "SpaceIterationsController", "{", "return", "&", "SpaceIterationsController", "{",...
// NewSpaceIterationsController creates a space-iterations controller.
[ "NewSpaceIterationsController", "creates", "a", "space", "-", "iterations", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/space_iterations.go#L31-L33
13,352
fabric8-services/fabric8-wit
controller/space_areas.go
NewSpaceAreasController
func NewSpaceAreasController(service *goa.Service, db application.DB, config SpaceAreasControllerConfig) *SpaceAreasController { return &SpaceAreasController{ Controller: service.NewController("SpaceAreasController"), db: db, config: config, } }
go
func NewSpaceAreasController(service *goa.Service, db application.DB, config SpaceAreasControllerConfig) *SpaceAreasController { return &SpaceAreasController{ Controller: service.NewController("SpaceAreasController"), db: db, config: config, } }
[ "func", "NewSpaceAreasController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "SpaceAreasControllerConfig", ")", "*", "SpaceAreasController", "{", "return", "&", "SpaceAreasController", "{", "Controller", ":", "...
// NewSpaceAreasController creates a space-Areas controller.
[ "NewSpaceAreasController", "creates", "a", "space", "-", "Areas", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/space_areas.go#L26-L32
13,353
fabric8-services/fabric8-wit
workitem/number_sequence/workitem_number_sequence_repository.go
NextVal
func (r *GormWorkItemNumberSequenceRepository) NextVal(ctx context.Context, spaceID uuid.UUID) (*int, error) { // upsert the next val, retrieves full row upsertStmt := fmt.Sprintf(`INSERT INTO %[1]s (space_id, current_val) VALUES ($1,1) ON CONFLICT (space_id) DO UPDATE SET current_val = %[1]s.current_val + EXCLUDED...
go
func (r *GormWorkItemNumberSequenceRepository) NextVal(ctx context.Context, spaceID uuid.UUID) (*int, error) { // upsert the next val, retrieves full row upsertStmt := fmt.Sprintf(`INSERT INTO %[1]s (space_id, current_val) VALUES ($1,1) ON CONFLICT (space_id) DO UPDATE SET current_val = %[1]s.current_val + EXCLUDED...
[ "func", "(", "r", "*", "GormWorkItemNumberSequenceRepository", ")", "NextVal", "(", "ctx", "context", ".", "Context", ",", "spaceID", "uuid", ".", "UUID", ")", "(", "*", "int", ",", "error", ")", "{", "// upsert the next val, retrieves full row", "upsertStmt", "...
// NextVal returns the next work item sequence number for the given space ID. Creates an entry in the DB if none was found before
[ "NextVal", "returns", "the", "next", "work", "item", "sequence", "number", "for", "the", "given", "space", "ID", ".", "Creates", "an", "entry", "in", "the", "DB", "if", "none", "was", "found", "before" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/number_sequence/workitem_number_sequence_repository.go#L30-L42
13,354
fabric8-services/fabric8-wit
workitem/board.go
Equal
func (wib Board) Equal(u convert.Equaler) bool { other, ok := u.(Board) if !ok { return false } if wib.ID != other.ID { return false } if wib.SpaceTemplateID != other.SpaceTemplateID { return false } if !convert.CascadeEqual(wib.Lifecycle, other.Lifecycle) { return false } if wib.Name != other.Name { ...
go
func (wib Board) Equal(u convert.Equaler) bool { other, ok := u.(Board) if !ok { return false } if wib.ID != other.ID { return false } if wib.SpaceTemplateID != other.SpaceTemplateID { return false } if !convert.CascadeEqual(wib.Lifecycle, other.Lifecycle) { return false } if wib.Name != other.Name { ...
[ "func", "(", "wib", "Board", ")", "Equal", "(", "u", "convert", ".", "Equaler", ")", "bool", "{", "other", ",", "ok", ":=", "u", ".", "(", "Board", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n", "if", "wib", ".", "ID", "...
// Equal returns true if two Board objects are equal; otherwise false is returned.
[ "Equal", "returns", "true", "if", "two", "Board", "objects", "are", "equal", ";", "otherwise", "false", "is", "returned", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/board.go#L33-L68
13,355
fabric8-services/fabric8-wit
workitem/board.go
Equal
func (wibc BoardColumn) Equal(u convert.Equaler) bool { other, ok := u.(BoardColumn) if !ok { return false } if wibc.ID != other.ID { return false } if wibc.BoardID != other.BoardID { return false } if !convert.CascadeEqual(wibc.Lifecycle, other.Lifecycle) { return false } if wibc.Name != other.Name {...
go
func (wibc BoardColumn) Equal(u convert.Equaler) bool { other, ok := u.(BoardColumn) if !ok { return false } if wibc.ID != other.ID { return false } if wibc.BoardID != other.BoardID { return false } if !convert.CascadeEqual(wibc.Lifecycle, other.Lifecycle) { return false } if wibc.Name != other.Name {...
[ "func", "(", "wibc", "BoardColumn", ")", "Equal", "(", "u", "convert", ".", "Equaler", ")", "bool", "{", "other", ",", "ok", ":=", "u", ".", "(", "BoardColumn", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n", "if", "wibc", "....
// Equal returns true if two BoardColumn objects are equal; otherwise false is returned.
[ "Equal", "returns", "true", "if", "two", "BoardColumn", "objects", "are", "equal", ";", "otherwise", "false", "is", "returned", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/board.go#L111-L138
13,356
fabric8-services/fabric8-wit
controller/user_service.go
Clean
func (c *UserServiceController) Clean(ctx *app.CleanUserServiceContext) error { err := c.CleanTenant(ctx, ctx.Remove) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } return ctx.OK([]byte{}) }
go
func (c *UserServiceController) Clean(ctx *app.CleanUserServiceContext) error { err := c.CleanTenant(ctx, ctx.Remove) if err != nil { return jsonapi.JSONErrorResponse(ctx, err) } return ctx.OK([]byte{}) }
[ "func", "(", "c", "*", "UserServiceController", ")", "Clean", "(", "ctx", "*", "app", ".", "CleanUserServiceContext", ")", "error", "{", "err", ":=", "c", ".", "CleanTenant", "(", "ctx", ",", "ctx", ".", "Remove", ")", "\n", "if", "err", "!=", "nil", ...
// Clean runs the clean action.
[ "Clean", "runs", "the", "clean", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/user_service.go#L33-L39
13,357
fabric8-services/fabric8-wit
account/user.go
PermanentDelete
func (m *GormUserRepository) PermanentDelete(ctx context.Context, ID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "user", "permanent_delete"}, time.Now()) tx := m.db.Unscoped().Delete(&User{ID: ID}) if err := tx.Error; err != nil { log.Error(ctx, map[string]interface{}{ "user_id": ID.String()...
go
func (m *GormUserRepository) PermanentDelete(ctx context.Context, ID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "user", "permanent_delete"}, time.Now()) tx := m.db.Unscoped().Delete(&User{ID: ID}) if err := tx.Error; err != nil { log.Error(ctx, map[string]interface{}{ "user_id": ID.String()...
[ "func", "(", "m", "*", "GormUserRepository", ")", "PermanentDelete", "(", "ctx", "context", ".", "Context", ",", "ID", "uuid", ".", "UUID", ")", "error", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", "{", "\"", "\"", ",", "\"", "...
// Delete removes a single record. This method use custom SQL to allow soft delete with GORM // to coexist with permanent delete.
[ "Delete", "removes", "a", "single", "record", ".", "This", "method", "use", "custom", "SQL", "to", "allow", "soft", "delete", "with", "GORM", "to", "coexist", "with", "permanent", "delete", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/account/user.go#L195-L216
13,358
fabric8-services/fabric8-wit
account/user.go
UserFilterByID
func UserFilterByID(userID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("id = ?", userID) } }
go
func UserFilterByID(userID uuid.UUID) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("id = ?", userID) } }
[ "func", "UserFilterByID", "(", "userID", "uuid", ".", "UUID", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "db...
// UserFilterByID is a gorm filter for User ID.
[ "UserFilterByID", "is", "a", "gorm", "filter", "for", "User", "ID", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/account/user.go#L248-L252
13,359
fabric8-services/fabric8-wit
account/user.go
UserFilterByEmail
func UserFilterByEmail(email string) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("email = ?", email) } }
go
func UserFilterByEmail(email string) func(db *gorm.DB) *gorm.DB { return func(db *gorm.DB) *gorm.DB { return db.Where("email = ?", email) } }
[ "func", "UserFilterByEmail", "(", "email", "string", ")", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "func", "(", "db", "*", "gorm", ".", "DB", ")", "*", "gorm", ".", "DB", "{", "return", "db", ".", "...
// UserFilterByEmail is a gorm filter for User ID.
[ "UserFilterByEmail", "is", "a", "gorm", "filter", "for", "User", "ID", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/account/user.go#L255-L259
13,360
fabric8-services/fabric8-wit
controller/iteration.go
NewIterationController
func NewIterationController(service *goa.Service, db application.DB, config IterationControllerConfiguration) *IterationController { return &IterationController{Controller: service.NewController("IterationController"), db: db, config: config} }
go
func NewIterationController(service *goa.Service, db application.DB, config IterationControllerConfiguration) *IterationController { return &IterationController{Controller: service.NewController("IterationController"), db: db, config: config} }
[ "func", "NewIterationController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "IterationControllerConfiguration", ")", "*", "IterationController", "{", "return", "&", "IterationController", "{", "Controller", ":", ...
// NewIterationController creates a iteration controller.
[ "NewIterationController", "creates", "a", "iteration", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/iteration.go#L44-L46
13,361
fabric8-services/fabric8-wit
controller/iteration.go
verifyUser
func verifyUser(ctx context.Context, currentUser uuid.UUID, sp *space.Space) (bool, bool, error) { authorized, err := authz.Authorize(ctx, sp.ID.String()) if err != nil { return false, false, err } var spaceOwner bool if uuid.Equal(currentUser, sp.OwnerID) { spaceOwner = true } return authorized, spaceOwner,...
go
func verifyUser(ctx context.Context, currentUser uuid.UUID, sp *space.Space) (bool, bool, error) { authorized, err := authz.Authorize(ctx, sp.ID.String()) if err != nil { return false, false, err } var spaceOwner bool if uuid.Equal(currentUser, sp.OwnerID) { spaceOwner = true } return authorized, spaceOwner,...
[ "func", "verifyUser", "(", "ctx", "context", ".", "Context", ",", "currentUser", "uuid", ".", "UUID", ",", "sp", "*", "space", ".", "Space", ")", "(", "bool", ",", "bool", ",", "error", ")", "{", "authorized", ",", "err", ":=", "authz", ".", "Authori...
// verifyUser checks if user is a space owner or a collaborator
[ "verifyUser", "checks", "if", "user", "is", "a", "space", "owner", "or", "a", "collaborator" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/iteration.go#L49-L59
13,362
fabric8-services/fabric8-wit
controller/iteration.go
ConvertIterations
func ConvertIterations(request *http.Request, Iterations []iteration.Iteration, additional ...IterationConvertFunc) []*app.Iteration { var is = []*app.Iteration{} for _, i := range Iterations { is = append(is, ConvertIteration(request, i, additional...)) } return is }
go
func ConvertIterations(request *http.Request, Iterations []iteration.Iteration, additional ...IterationConvertFunc) []*app.Iteration { var is = []*app.Iteration{} for _, i := range Iterations { is = append(is, ConvertIteration(request, i, additional...)) } return is }
[ "func", "ConvertIterations", "(", "request", "*", "http", ".", "Request", ",", "Iterations", "[", "]", "iteration", ".", "Iteration", ",", "additional", "...", "IterationConvertFunc", ")", "[", "]", "*", "app", ".", "Iteration", "{", "var", "is", "=", "[",...
// ConvertIterations converts between internal and external REST representation
[ "ConvertIterations", "converts", "between", "internal", "and", "external", "REST", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/iteration.go#L447-L453
13,363
fabric8-services/fabric8-wit
controller/iteration.go
ConvertIteration
func ConvertIteration(request *http.Request, itr iteration.Iteration, additional ...IterationConvertFunc) *app.Iteration { iterationType := iteration.APIStringTypeIteration spaceID := itr.SpaceID.String() relatedURL := rest.AbsoluteURL(request, app.IterationHref(itr.ID)) spaceRelatedURL := rest.AbsoluteURL(request,...
go
func ConvertIteration(request *http.Request, itr iteration.Iteration, additional ...IterationConvertFunc) *app.Iteration { iterationType := iteration.APIStringTypeIteration spaceID := itr.SpaceID.String() relatedURL := rest.AbsoluteURL(request, app.IterationHref(itr.ID)) spaceRelatedURL := rest.AbsoluteURL(request,...
[ "func", "ConvertIteration", "(", "request", "*", "http", ".", "Request", ",", "itr", "iteration", ".", "Iteration", ",", "additional", "...", "IterationConvertFunc", ")", "*", "app", ".", "Iteration", "{", "iterationType", ":=", "iteration", ".", "APIStringTypeI...
// ConvertIteration converts between internal and external REST representation
[ "ConvertIteration", "converts", "between", "internal", "and", "external", "REST", "representation" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/iteration.go#L456-L520
13,364
fabric8-services/fabric8-wit
controller/iteration.go
ConvertIterationSimple
func ConvertIterationSimple(request *http.Request, id interface{}) (*app.GenericData, *app.GenericLinks) { t := iteration.APIStringTypeIteration i := fmt.Sprint(id) data := &app.GenericData{ Type: &t, ID: &i, } relatedURL := rest.AbsoluteURL(request, app.IterationHref(i)) links := &app.GenericLinks{ Self:...
go
func ConvertIterationSimple(request *http.Request, id interface{}) (*app.GenericData, *app.GenericLinks) { t := iteration.APIStringTypeIteration i := fmt.Sprint(id) data := &app.GenericData{ Type: &t, ID: &i, } relatedURL := rest.AbsoluteURL(request, app.IterationHref(i)) links := &app.GenericLinks{ Self:...
[ "func", "ConvertIterationSimple", "(", "request", "*", "http", ".", "Request", ",", "id", "interface", "{", "}", ")", "(", "*", "app", ".", "GenericData", ",", "*", "app", ".", "GenericLinks", ")", "{", "t", ":=", "iteration", ".", "APIStringTypeIteration"...
// ConvertIterationSimple converts a simple Iteration ID into a Generic // Relationship data+links element
[ "ConvertIterationSimple", "converts", "a", "simple", "Iteration", "ID", "into", "a", "Generic", "Relationship", "data", "+", "links", "element" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/iteration.go#L524-L537
13,365
fabric8-services/fabric8-wit
controller/iteration.go
updateIterationsWithCounts
func updateIterationsWithCounts(wiCounts map[string]workitem.WICountsPerIteration) IterationConvertFunc { return func(request *http.Request, itr *iteration.Iteration, appIteration *app.Iteration) { var counts workitem.WICountsPerIteration if _, ok := wiCounts[appIteration.ID.String()]; ok { counts = wiCounts[ap...
go
func updateIterationsWithCounts(wiCounts map[string]workitem.WICountsPerIteration) IterationConvertFunc { return func(request *http.Request, itr *iteration.Iteration, appIteration *app.Iteration) { var counts workitem.WICountsPerIteration if _, ok := wiCounts[appIteration.ID.String()]; ok { counts = wiCounts[ap...
[ "func", "updateIterationsWithCounts", "(", "wiCounts", "map", "[", "string", "]", "workitem", ".", "WICountsPerIteration", ")", "IterationConvertFunc", "{", "return", "func", "(", "request", "*", "http", ".", "Request", ",", "itr", "*", "iteration", ".", "Iterat...
// updateIterationsWithCounts accepts map of 'iterationID to a workitem.WICountsPerIteration instance'. // This function returns function of type IterationConvertFunc // Inner function is able to access `wiCounts` in closure and it is responsible // for adding 'closed' and 'total' count of WI in relationship's meta for...
[ "updateIterationsWithCounts", "accepts", "map", "of", "iterationID", "to", "a", "workitem", ".", "WICountsPerIteration", "instance", ".", "This", "function", "returns", "function", "of", "type", "IterationConvertFunc", "Inner", "function", "is", "able", "to", "access"...
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/iteration.go#L572-L592
13,366
fabric8-services/fabric8-wit
workitem/link/link_revision_repository.go
Create
func (r *GormWorkItemLinkRevisionRepository) Create(ctx context.Context, modifierID uuid.UUID, revisionType RevisionType, l WorkItemLink) error { log.Debug(nil, map[string]interface{}{ "modifier_id": modifierID, "revision_type": revisionType, }, "Storing a revision after operation on work item link.") tx := r....
go
func (r *GormWorkItemLinkRevisionRepository) Create(ctx context.Context, modifierID uuid.UUID, revisionType RevisionType, l WorkItemLink) error { log.Debug(nil, map[string]interface{}{ "modifier_id": modifierID, "revision_type": revisionType, }, "Storing a revision after operation on work item link.") tx := r....
[ "func", "(", "r", "*", "GormWorkItemLinkRevisionRepository", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "modifierID", "uuid", ".", "UUID", ",", "revisionType", "RevisionType", ",", "l", "WorkItemLink", ")", "error", "{", "log", ".", "Debug", ...
// Create stores a new revision for the given work item link.
[ "Create", "stores", "a", "new", "revision", "for", "the", "given", "work", "item", "link", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/link_revision_repository.go#L35-L56
13,367
fabric8-services/fabric8-wit
remoteworkitem/trackeritem_repository.go
Upload
func Upload(db *gorm.DB, tID uuid.UUID, item TrackerItemContent) error { remoteID := item.ID content := string(item.Content) var ti TrackerItem if db.Where("remote_item_id = ? AND tracker_id = ?", remoteID, tID).Find(&ti).RecordNotFound() { ti = TrackerItem{ Item: content, RemoteItemID: remoteID, ...
go
func Upload(db *gorm.DB, tID uuid.UUID, item TrackerItemContent) error { remoteID := item.ID content := string(item.Content) var ti TrackerItem if db.Where("remote_item_id = ? AND tracker_id = ?", remoteID, tID).Find(&ti).RecordNotFound() { ti = TrackerItem{ Item: content, RemoteItemID: remoteID, ...
[ "func", "Upload", "(", "db", "*", "gorm", ".", "DB", ",", "tID", "uuid", ".", "UUID", ",", "item", "TrackerItemContent", ")", "error", "{", "remoteID", ":=", "item", ".", "ID", "\n", "content", ":=", "string", "(", "item", ".", "Content", ")", "\n\n"...
// Upload imports the items into database
[ "Upload", "imports", "the", "items", "into", "database" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/remoteworkitem/trackeritem_repository.go#L19-L33
13,368
fabric8-services/fabric8-wit
remoteworkitem/trackeritem_repository.go
ConvertToWorkItemModel
func ConvertToWorkItemModel(ctx context.Context, db *gorm.DB, item TrackerItemContent, tq TrackerSchedule) (*workitem.WorkItem, error) { remoteID := item.ID content := string(item.Content) trackerItem := TrackerItem{Item: content, RemoteItemID: remoteID, TrackerID: tq.TrackerID} // Converting the remote item to a l...
go
func ConvertToWorkItemModel(ctx context.Context, db *gorm.DB, item TrackerItemContent, tq TrackerSchedule) (*workitem.WorkItem, error) { remoteID := item.ID content := string(item.Content) trackerItem := TrackerItem{Item: content, RemoteItemID: remoteID, TrackerID: tq.TrackerID} // Converting the remote item to a l...
[ "func", "ConvertToWorkItemModel", "(", "ctx", "context", ".", "Context", ",", "db", "*", "gorm", ".", "DB", ",", "item", "TrackerItemContent", ",", "tq", "TrackerSchedule", ")", "(", "*", "workitem", ".", "WorkItem", ",", "error", ")", "{", "remoteID", ":=...
// Map a remote work item into an WIT work item and persist it into the database.
[ "Map", "a", "remote", "work", "item", "into", "an", "WIT", "work", "item", "and", "persist", "it", "into", "the", "database", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/remoteworkitem/trackeritem_repository.go#L36-L58
13,369
fabric8-services/fabric8-wit
remoteworkitem/trackeritem_repository.go
setWorkItemFields
func setWorkItemFields(ctx context.Context, db *gorm.DB, remoteWorkItem RemoteWorkItem, tq TrackerSchedule) (*workitem.WorkItem, error) { identityRepository := account.NewIdentityRepository(db) //spaceSelfURL := rest.AbsoluteURL(goa.ContextRequest(ctx), app.SpaceHref(spaceID.String())) workItem := workitem.WorkItem{...
go
func setWorkItemFields(ctx context.Context, db *gorm.DB, remoteWorkItem RemoteWorkItem, tq TrackerSchedule) (*workitem.WorkItem, error) { identityRepository := account.NewIdentityRepository(db) //spaceSelfURL := rest.AbsoluteURL(goa.ContextRequest(ctx), app.SpaceHref(spaceID.String())) workItem := workitem.WorkItem{...
[ "func", "setWorkItemFields", "(", "ctx", "context", ".", "Context", ",", "db", "*", "gorm", ".", "DB", ",", "remoteWorkItem", "RemoteWorkItem", ",", "tq", "TrackerSchedule", ")", "(", "*", "workitem", ".", "WorkItem", ",", "error", ")", "{", "identityReposit...
// setWorkItemFields retrieves data from remoteWorkItem structure and sets it to relevant fields in work item model
[ "setWorkItemFields", "retrieves", "data", "from", "remoteWorkItem", "structure", "and", "sets", "it", "to", "relevant", "fields", "in", "work", "item", "model" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/remoteworkitem/trackeritem_repository.go#L61-L120
13,370
fabric8-services/fabric8-wit
workitem/workitemtype_repository.go
Load
func (r *GormWorkItemTypeRepository) Load(ctx context.Context, id uuid.UUID) (*WorkItemType, error) { defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "load"}, time.Now()) log.Debug(ctx, map[string]interface{}{ "wit_id": id, }, "Loading work item type") res, ok := cache.Get(id) if !ok { log.Info(ct...
go
func (r *GormWorkItemTypeRepository) Load(ctx context.Context, id uuid.UUID) (*WorkItemType, error) { defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "load"}, time.Now()) log.Debug(ctx, map[string]interface{}{ "wit_id": id, }, "Loading work item type") res, ok := cache.Get(id) if !ok { log.Info(ct...
[ "func", "(", "r", "*", "GormWorkItemTypeRepository", ")", "Load", "(", "ctx", "context", ".", "Context", ",", "id", "uuid", ".", "UUID", ")", "(", "*", "WorkItemType", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string"...
// Load returns the work item for the given spaceID and id // returns NotFoundError, InternalError
[ "Load", "returns", "the", "work", "item", "for", "the", "given", "spaceID", "and", "id", "returns", "NotFoundError", "InternalError" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype_repository.go#L45-L75
13,371
fabric8-services/fabric8-wit
workitem/workitemtype_repository.go
Create
func (r *GormWorkItemTypeRepository) Create(ctx context.Context, spaceTemplateID uuid.UUID, id *uuid.UUID, extendedTypeID *uuid.UUID, name string, description *string, icon string, fields FieldDefinitions, canConstruct bool) (*WorkItemType, error) { wit := WorkItemType{ SpaceTemplateID: spaceTemplateID, Name: ...
go
func (r *GormWorkItemTypeRepository) Create(ctx context.Context, spaceTemplateID uuid.UUID, id *uuid.UUID, extendedTypeID *uuid.UUID, name string, description *string, icon string, fields FieldDefinitions, canConstruct bool) (*WorkItemType, error) { wit := WorkItemType{ SpaceTemplateID: spaceTemplateID, Name: ...
[ "func", "(", "r", "*", "GormWorkItemTypeRepository", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "spaceTemplateID", "uuid", ".", "UUID", ",", "id", "*", "uuid", ".", "UUID", ",", "extendedTypeID", "*", "uuid", ".", "UUID", ",", "name", "st...
// Create creates a new work item type according to the given parameters.
[ "Create", "creates", "a", "new", "work", "item", "type", "according", "to", "the", "given", "parameters", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype_repository.go#L97-L115
13,372
fabric8-services/fabric8-wit
workitem/workitemtype_repository.go
CreateFromModel
func (r *GormWorkItemTypeRepository) CreateFromModel(ctx context.Context, model WorkItemType) (*WorkItemType, error) { defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "create"}, time.Now()) if model.ID == uuid.Nil { model.ID = uuid.NewV4() } allFields := map[string]FieldDefinition{} path := LtreeS...
go
func (r *GormWorkItemTypeRepository) CreateFromModel(ctx context.Context, model WorkItemType) (*WorkItemType, error) { defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "create"}, time.Now()) if model.ID == uuid.Nil { model.ID = uuid.NewV4() } allFields := map[string]FieldDefinition{} path := LtreeS...
[ "func", "(", "r", "*", "GormWorkItemTypeRepository", ")", "CreateFromModel", "(", "ctx", "context", ".", "Context", ",", "model", "WorkItemType", ")", "(", "*", "WorkItemType", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "st...
// CreateFromModel creates a new work item type in the repository based on the // given model of it.
[ "CreateFromModel", "creates", "a", "new", "work", "item", "type", "in", "the", "repository", "based", "on", "the", "given", "model", "of", "it", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype_repository.go#L119-L161
13,373
fabric8-services/fabric8-wit
workitem/workitemtype_repository.go
ListPlannerItemTypes
func (r *GormWorkItemTypeRepository) ListPlannerItemTypes(ctx context.Context, spaceTemplateID uuid.UUID) ([]WorkItemType, error) { defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "listPlannerItemTypes"}, time.Now()) // check space template exists if err := spacetemplate.NewRepository(r.db).CheckExists...
go
func (r *GormWorkItemTypeRepository) ListPlannerItemTypes(ctx context.Context, spaceTemplateID uuid.UUID) ([]WorkItemType, error) { defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "listPlannerItemTypes"}, time.Now()) // check space template exists if err := spacetemplate.NewRepository(r.db).CheckExists...
[ "func", "(", "r", "*", "GormWorkItemTypeRepository", ")", "ListPlannerItemTypes", "(", "ctx", "context", ".", "Context", ",", "spaceTemplateID", "uuid", ".", "UUID", ")", "(", "[", "]", "WorkItemType", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSin...
// ListPlannerItemTypes returns work item types that derives from PlannerItem type
[ "ListPlannerItemTypes", "returns", "work", "item", "types", "that", "derives", "from", "PlannerItem", "type" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype_repository.go#L164-L190
13,374
fabric8-services/fabric8-wit
workitem/workitemtype_repository.go
AddChildTypes
func (r *GormWorkItemTypeRepository) AddChildTypes(ctx context.Context, parentTypeID uuid.UUID, childTypeIDs []uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "add_child_types"}, time.Now()) if len(childTypeIDs) <= 0 { return nil } // Create entries for each child in the type list ...
go
func (r *GormWorkItemTypeRepository) AddChildTypes(ctx context.Context, parentTypeID uuid.UUID, childTypeIDs []uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "add_child_types"}, time.Now()) if len(childTypeIDs) <= 0 { return nil } // Create entries for each child in the type list ...
[ "func", "(", "r", "*", "GormWorkItemTypeRepository", ")", "AddChildTypes", "(", "ctx", "context", ".", "Context", ",", "parentTypeID", "uuid", ".", "UUID", ",", "childTypeIDs", "[", "]", "uuid", ".", "UUID", ")", "error", "{", "defer", "goa", ".", "Measure...
// AddChildTypes adds the given child work item types to the parent work item // type.
[ "AddChildTypes", "adds", "the", "given", "child", "work", "item", "types", "to", "the", "parent", "work", "item", "type", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype_repository.go#L235-L255
13,375
fabric8-services/fabric8-wit
workitem/workitemtype_repository.go
loadChildTypeList
func (r *GormWorkItemTypeRepository) loadChildTypeList(ctx context.Context, parentTypeID uuid.UUID) ([]uuid.UUID, error) { types := []ChildType{} db := r.db.Model(&types).Where("parent_work_item_type_id=?", parentTypeID).Order("position ASC").Find(&types) if db.RecordNotFound() { log.Error(ctx, map[string]interfac...
go
func (r *GormWorkItemTypeRepository) loadChildTypeList(ctx context.Context, parentTypeID uuid.UUID) ([]uuid.UUID, error) { types := []ChildType{} db := r.db.Model(&types).Where("parent_work_item_type_id=?", parentTypeID).Order("position ASC").Find(&types) if db.RecordNotFound() { log.Error(ctx, map[string]interfac...
[ "func", "(", "r", "*", "GormWorkItemTypeRepository", ")", "loadChildTypeList", "(", "ctx", "context", ".", "Context", ",", "parentTypeID", "uuid", ".", "UUID", ")", "(", "[", "]", "uuid", ".", "UUID", ",", "error", ")", "{", "types", ":=", "[", "]", "C...
// loadChildTypeList loads all child work item types associated with the given // work item type
[ "loadChildTypeList", "loads", "all", "child", "work", "item", "types", "associated", "with", "the", "given", "work", "item", "type" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype_repository.go#L259-L274
13,376
fabric8-services/fabric8-wit
remoteworkitem/tracker_repository.go
Create
func (r *GormTrackerRepository) Create(ctx context.Context, t *Tracker) error { //URL Validation isValid := govalidator.IsURL(t.URL) if isValid != true { return BadParameterError{parameter: "url", value: t.URL} } _, present := RemoteWorkItemImplRegistry[t.Type] // Ensure we support this remote tracker. if pre...
go
func (r *GormTrackerRepository) Create(ctx context.Context, t *Tracker) error { //URL Validation isValid := govalidator.IsURL(t.URL) if isValid != true { return BadParameterError{parameter: "url", value: t.URL} } _, present := RemoteWorkItemImplRegistry[t.Type] // Ensure we support this remote tracker. if pre...
[ "func", "(", "r", "*", "GormTrackerRepository", ")", "Create", "(", "ctx", "context", ".", "Context", ",", "t", "*", "Tracker", ")", "error", "{", "//URL Validation", "isValid", ":=", "govalidator", ".", "IsURL", "(", "t", ".", "URL", ")", "\n", "if", ...
// Create creates a new tracker configuration in the repository // returns BadParameterError, ConversionError or InternalError
[ "Create", "creates", "a", "new", "tracker", "configuration", "in", "the", "repository", "returns", "BadParameterError", "ConversionError", "or", "InternalError" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/remoteworkitem/tracker_repository.go#L44-L64
13,377
fabric8-services/fabric8-wit
remoteworkitem/tracker_repository.go
Save
func (r *GormTrackerRepository) Save(ctx context.Context, t *Tracker) (*Tracker, error) { defer goa.MeasureSince([]string{"goa", "db", "tracker", "save"}, time.Now()) res := Tracker{} tx := r.db.Where("id = ?", t.ID).Find(&res) if tx.RecordNotFound() { log.Error(ctx, map[string]interface{}{ "err": tx.Er...
go
func (r *GormTrackerRepository) Save(ctx context.Context, t *Tracker) (*Tracker, error) { defer goa.MeasureSince([]string{"goa", "db", "tracker", "save"}, time.Now()) res := Tracker{} tx := r.db.Where("id = ?", t.ID).Find(&res) if tx.RecordNotFound() { log.Error(ctx, map[string]interface{}{ "err": tx.Er...
[ "func", "(", "r", "*", "GormTrackerRepository", ")", "Save", "(", "ctx", "context", ".", "Context", ",", "t", "*", "Tracker", ")", "(", "*", "Tracker", ",", "error", ")", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", "{", "\"", ...
// Save updates the given tracker in storage. // returns NotFoundError, ConversionError or InternalError
[ "Save", "updates", "the", "given", "tracker", "in", "storage", ".", "returns", "NotFoundError", "ConversionError", "or", "InternalError" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/remoteworkitem/tracker_repository.go#L107-L132
13,378
fabric8-services/fabric8-wit
remoteworkitem/tracker_repository.go
Delete
func (r *GormTrackerRepository) Delete(ctx context.Context, ID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "tracker", "delete"}, time.Now()) if ID == uuid.Nil { log.Error(ctx, map[string]interface{}{ "err": errors.NewNotFoundError("tracker", ID.String()), "tracker_id": ID.String(), ...
go
func (r *GormTrackerRepository) Delete(ctx context.Context, ID uuid.UUID) error { defer goa.MeasureSince([]string{"goa", "db", "tracker", "delete"}, time.Now()) if ID == uuid.Nil { log.Error(ctx, map[string]interface{}{ "err": errors.NewNotFoundError("tracker", ID.String()), "tracker_id": ID.String(), ...
[ "func", "(", "r", "*", "GormTrackerRepository", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "ID", "uuid", ".", "UUID", ")", "error", "{", "defer", "goa", ".", "MeasureSince", "(", "[", "]", "string", "{", "\"", "\"", ",", "\"", "\"", ...
// Delete deletes the tracker with the given id // returns NotFoundError or InternalError
[ "Delete", "deletes", "the", "tracker", "with", "the", "given", "id", "returns", "NotFoundError", "or", "InternalError" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/remoteworkitem/tracker_repository.go#L136-L162
13,379
fabric8-services/fabric8-wit
closeable/close.go
Close
func Close(ctx context.Context, c io.Closer) { // need to verify that the value of the `c` interface if not nil, too if c != nil && !reflect.ValueOf(c).IsNil() { err := c.Close() if err != nil { log.Error(ctx, map[string]interface{}{"error": err.Error()}, "error while closing the resource") } } }
go
func Close(ctx context.Context, c io.Closer) { // need to verify that the value of the `c` interface if not nil, too if c != nil && !reflect.ValueOf(c).IsNil() { err := c.Close() if err != nil { log.Error(ctx, map[string]interface{}{"error": err.Error()}, "error while closing the resource") } } }
[ "func", "Close", "(", "ctx", "context", ".", "Context", ",", "c", "io", ".", "Closer", ")", "{", "// need to verify that the value of the `c` interface if not nil, too", "if", "c", "!=", "nil", "&&", "!", "reflect", ".", "ValueOf", "(", "c", ")", ".", "IsNil",...
// Close closes the given resource and logs the error if something wrong happened
[ "Close", "closes", "the", "given", "resource", "and", "logs", "the", "error", "if", "something", "wrong", "happened" ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/closeable/close.go#L12-L21
13,380
fabric8-services/fabric8-wit
controller/render.go
Render
func (c *RenderController) Render(ctx *app.RenderRenderContext) error { content := ctx.Payload.Data.Attributes.Content markup := ctx.Payload.Data.Attributes.Markup if !rendering.IsMarkupSupported(markup) { return jsonapi.JSONErrorResponse(ctx, errors.NewBadParameterError("Unsupported markup type", markup)) } htm...
go
func (c *RenderController) Render(ctx *app.RenderRenderContext) error { content := ctx.Payload.Data.Attributes.Content markup := ctx.Payload.Data.Attributes.Markup if !rendering.IsMarkupSupported(markup) { return jsonapi.JSONErrorResponse(ctx, errors.NewBadParameterError("Unsupported markup type", markup)) } htm...
[ "func", "(", "c", "*", "RenderController", ")", "Render", "(", "ctx", "*", "app", ".", "RenderRenderContext", ")", "error", "{", "content", ":=", "ctx", ".", "Payload", ".", "Data", ".", "Attributes", ".", "Content", "\n", "markup", ":=", "ctx", ".", "...
// Render runs the render action.
[ "Render", "runs", "the", "render", "action", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/render.go#L28-L42
13,381
fabric8-services/fabric8-wit
jsonapi/jsonapi_utility.go
ErrorToJSONAPIError
func ErrorToJSONAPIError(ctx context.Context, err error) (app.JSONAPIError, int) { cause := errs.Cause(err) detail := cause.Error() var title, code string var statusCode int var id *string log.Error(ctx, map[string]interface{}{"err": cause, "error_message": cause.Error(), "err_type": reflect.TypeOf(cause)}, "an e...
go
func ErrorToJSONAPIError(ctx context.Context, err error) (app.JSONAPIError, int) { cause := errs.Cause(err) detail := cause.Error() var title, code string var statusCode int var id *string log.Error(ctx, map[string]interface{}{"err": cause, "error_message": cause.Error(), "err_type": reflect.TypeOf(cause)}, "an e...
[ "func", "ErrorToJSONAPIError", "(", "ctx", "context", ".", "Context", ",", "err", "error", ")", "(", "app", ".", "JSONAPIError", ",", "int", ")", "{", "cause", ":=", "errs", ".", "Cause", "(", "err", ")", "\n", "detail", ":=", "cause", ".", "Error", ...
// ErrorToJSONAPIError returns the JSONAPI representation // of an error and the HTTP status code that will be associated with it. // This function knows about the models package and the errors from there // as well as goa error classes.
[ "ErrorToJSONAPIError", "returns", "the", "JSONAPI", "representation", "of", "an", "error", "and", "the", "HTTP", "status", "code", "that", "will", "be", "associated", "with", "it", ".", "This", "function", "knows", "about", "the", "models", "package", "and", "...
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/jsonapi/jsonapi_utility.go#L37-L103
13,382
fabric8-services/fabric8-wit
jsonapi/jsonapi_utility.go
ErrorToJSONAPIErrors
func ErrorToJSONAPIErrors(ctx context.Context, err error) (*app.JSONAPIErrors, int) { jerr, httpStatusCode := ErrorToJSONAPIError(ctx, err) jerrors := app.JSONAPIErrors{} jerrors.Errors = append(jerrors.Errors, &jerr) return &jerrors, httpStatusCode }
go
func ErrorToJSONAPIErrors(ctx context.Context, err error) (*app.JSONAPIErrors, int) { jerr, httpStatusCode := ErrorToJSONAPIError(ctx, err) jerrors := app.JSONAPIErrors{} jerrors.Errors = append(jerrors.Errors, &jerr) return &jerrors, httpStatusCode }
[ "func", "ErrorToJSONAPIErrors", "(", "ctx", "context", ".", "Context", ",", "err", "error", ")", "(", "*", "app", ".", "JSONAPIErrors", ",", "int", ")", "{", "jerr", ",", "httpStatusCode", ":=", "ErrorToJSONAPIError", "(", "ctx", ",", "err", ")", "\n", "...
// ErrorToJSONAPIErrors is a convenience function if you // just want to return one error from the models package as a JSONAPI errors // array.
[ "ErrorToJSONAPIErrors", "is", "a", "convenience", "function", "if", "you", "just", "want", "to", "return", "one", "error", "from", "the", "models", "package", "as", "a", "JSONAPI", "errors", "array", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/jsonapi/jsonapi_utility.go#L108-L113
13,383
fabric8-services/fabric8-wit
controller/workitems.go
NewWorkitemsController
func NewWorkitemsController(service *goa.Service, db application.DB, config WorkItemControllerConfig) *WorkitemsController { return NewNotifyingWorkitemsController(service, db, &notification.DevNullChannel{}, config) }
go
func NewWorkitemsController(service *goa.Service, db application.DB, config WorkItemControllerConfig) *WorkitemsController { return NewNotifyingWorkitemsController(service, db, &notification.DevNullChannel{}, config) }
[ "func", "NewWorkitemsController", "(", "service", "*", "goa", ".", "Service", ",", "db", "application", ".", "DB", ",", "config", "WorkItemControllerConfig", ")", "*", "WorkitemsController", "{", "return", "NewNotifyingWorkitemsController", "(", "service", ",", "db"...
// NewWorkitemsController creates a workitems controller.
[ "NewWorkitemsController", "creates", "a", "workitems", "controller", "." ]
54759c80c42ff2cf29b352e0f6c9330ce4ad7fce
https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/workitems.go#L35-L37
13,384
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
13,385
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
13,386
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
13,387
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
13,388
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
13,389
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
13,390
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
13,391
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
13,392
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
13,393
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
13,394
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
13,395
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
13,396
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
13,397
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
13,398
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
13,399
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