id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
135,500 | fabric8-services/fabric8-wit | controller/users.go | UpdateUserAsServiceAccount | func (c *UsersController) UpdateUserAsServiceAccount(ctx *app.UpdateUserAsServiceAccountUsersContext) error {
isSvcAccount, err := isServiceAccount(ctx, serviceNameAuth)
if err != nil {
log.Error(ctx, map[string]interface{}{
"err": err,
"identity_id": ctx.ID,
}, "failed to determine if account is a... | go | func (c *UsersController) UpdateUserAsServiceAccount(ctx *app.UpdateUserAsServiceAccountUsersContext) error {
isSvcAccount, err := isServiceAccount(ctx, serviceNameAuth)
if err != nil {
log.Error(ctx, map[string]interface{}{
"err": err,
"identity_id": ctx.ID,
}, "failed to determine if account is a... | [
"func",
"(",
"c",
"*",
"UsersController",
")",
"UpdateUserAsServiceAccount",
"(",
"ctx",
"*",
"app",
".",
"UpdateUserAsServiceAccountUsersContext",
")",
"error",
"{",
"isSvcAccount",
",",
"err",
":=",
"isServiceAccount",
"(",
"ctx",
",",
"serviceNameAuth",
")",
"\... | // UpdateUserAsServiceAccount updates a user when requested using a service account token | [
"UpdateUserAsServiceAccount",
"updates",
"a",
"user",
"when",
"requested",
"using",
"a",
"service",
"account",
"token"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/users.go#L362-L385 |
135,501 | fabric8-services/fabric8-wit | controller/users.go | Update | func (c *UsersController) Update(ctx *app.UpdateUsersContext) error {
return proxy.RouteHTTP(ctx, c.config.GetAuthShortServiceHostName())
} | go | func (c *UsersController) Update(ctx *app.UpdateUsersContext) error {
return proxy.RouteHTTP(ctx, c.config.GetAuthShortServiceHostName())
} | [
"func",
"(",
"c",
"*",
"UsersController",
")",
"Update",
"(",
"ctx",
"*",
"app",
".",
"UpdateUsersContext",
")",
"error",
"{",
"return",
"proxy",
".",
"RouteHTTP",
"(",
"ctx",
",",
"c",
".",
"config",
".",
"GetAuthShortServiceHostName",
"(",
")",
")",
"\... | // Update updates the authorized user based on the provided Token | [
"Update",
"updates",
"the",
"authorized",
"user",
"based",
"on",
"the",
"provided",
"Token"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/users.go#L487-L489 |
135,502 | fabric8-services/fabric8-wit | query/query.go | Create | func (r *GormQueryRepository) Create(ctx context.Context, q *Query) error {
defer goa.MeasureSince([]string{"goa", "db", "Query", "create"}, time.Now())
q.ID = uuid.NewV4()
if q.Creator == uuid.Nil {
return errors.NewBadParameterError("creator cannot be nil", q.Creator).Expected("valid user ID")
}
var v map[stri... | go | func (r *GormQueryRepository) Create(ctx context.Context, q *Query) error {
defer goa.MeasureSince([]string{"goa", "db", "Query", "create"}, time.Now())
q.ID = uuid.NewV4()
if q.Creator == uuid.Nil {
return errors.NewBadParameterError("creator cannot be nil", q.Creator).Expected("valid user ID")
}
var v map[stri... | [
"func",
"(",
"r",
"*",
"GormQueryRepository",
")",
"Create",
"(",
"ctx",
"context",
".",
"Context",
",",
"q",
"*",
"Query",
")",
"error",
"{",
"defer",
"goa",
".",
"MeasureSince",
"(",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\""... | // Create a new query | [
"Create",
"a",
"new",
"query"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/query/query.go#L82-L119 |
135,503 | fabric8-services/fabric8-wit | query/query.go | Save | func (r *GormQueryRepository) Save(ctx context.Context, q Query) (*Query, error) {
defer goa.MeasureSince([]string{"goa", "db", "query", "save"}, time.Now())
if strings.TrimSpace(q.Title) == "" {
return nil, errors.NewBadParameterError("query title cannot be empty string", q.Title).Expected("non empty string")
}
... | go | func (r *GormQueryRepository) Save(ctx context.Context, q Query) (*Query, error) {
defer goa.MeasureSince([]string{"goa", "db", "query", "save"}, time.Now())
if strings.TrimSpace(q.Title) == "" {
return nil, errors.NewBadParameterError("query title cannot be empty string", q.Title).Expected("non empty string")
}
... | [
"func",
"(",
"r",
"*",
"GormQueryRepository",
")",
"Save",
"(",
"ctx",
"context",
".",
"Context",
",",
"q",
"Query",
")",
"(",
"*",
"Query",
",",
"error",
")",
"{",
"defer",
"goa",
".",
"MeasureSince",
"(",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",... | // Save update the given query | [
"Save",
"update",
"the",
"given",
"query"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/query/query.go#L122-L173 |
135,504 | fabric8-services/fabric8-wit | query/query.go | Load | func (r *GormQueryRepository) Load(ctx context.Context, ID uuid.UUID, spaceID uuid.UUID) (*Query, error) {
defer goa.MeasureSince([]string{"goa", "db", "query", "show"}, time.Now())
q := Query{}
tx := r.db.Where("id = ? and space_id = ?", ID, spaceID).First(&q)
if tx.RecordNotFound() {
log.Error(ctx, map[string]i... | go | func (r *GormQueryRepository) Load(ctx context.Context, ID uuid.UUID, spaceID uuid.UUID) (*Query, error) {
defer goa.MeasureSince([]string{"goa", "db", "query", "show"}, time.Now())
q := Query{}
tx := r.db.Where("id = ? and space_id = ?", ID, spaceID).First(&q)
if tx.RecordNotFound() {
log.Error(ctx, map[string]i... | [
"func",
"(",
"r",
"*",
"GormQueryRepository",
")",
"Load",
"(",
"ctx",
"context",
".",
"Context",
",",
"ID",
"uuid",
".",
"UUID",
",",
"spaceID",
"uuid",
".",
"UUID",
")",
"(",
"*",
"Query",
",",
"error",
")",
"{",
"defer",
"goa",
".",
"MeasureSince"... | // Load Query in a space | [
"Load",
"Query",
"in",
"a",
"space"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/query/query.go#L198-L216 |
135,505 | fabric8-services/fabric8-wit | query/query.go | Delete | func (r *GormQueryRepository) Delete(ctx context.Context, ID uuid.UUID) error {
defer goa.MeasureSince([]string{"goa", "db", "query", "delete"}, time.Now())
q := Query{ID: ID}
tx := r.db.Delete(q)
if err := tx.Error; err != nil {
log.Error(ctx, map[string]interface{}{
"query_id": ID.String(),
}, "unable to ... | go | func (r *GormQueryRepository) Delete(ctx context.Context, ID uuid.UUID) error {
defer goa.MeasureSince([]string{"goa", "db", "query", "delete"}, time.Now())
q := Query{ID: ID}
tx := r.db.Delete(q)
if err := tx.Error; err != nil {
log.Error(ctx, map[string]interface{}{
"query_id": ID.String(),
}, "unable to ... | [
"func",
"(",
"r",
"*",
"GormQueryRepository",
")",
"Delete",
"(",
"ctx",
"context",
".",
"Context",
",",
"ID",
"uuid",
".",
"UUID",
")",
"error",
"{",
"defer",
"goa",
".",
"MeasureSince",
"(",
"[",
"]",
"string",
"{",
"\"",
"\"",
",",
"\"",
"\"",
"... | // Delete deletes the query with the given id, returns NotFoundError or InternalError | [
"Delete",
"deletes",
"the",
"query",
"with",
"the",
"given",
"id",
"returns",
"NotFoundError",
"or",
"InternalError"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/query/query.go#L219-L237 |
135,506 | fabric8-services/fabric8-wit | rest/proxy/error.go | ConvertHTTPErrorCode | func ConvertHTTPErrorCode(statusCode int, responseBody string) error {
switch statusCode {
case http.StatusNotFound:
return errors.NewNotFoundErrorFromString(responseBody)
case http.StatusBadRequest:
return errors.NewBadParameterErrorFromString(responseBody)
case http.StatusConflict:
return errors.NewData... | go | func ConvertHTTPErrorCode(statusCode int, responseBody string) error {
switch statusCode {
case http.StatusNotFound:
return errors.NewNotFoundErrorFromString(responseBody)
case http.StatusBadRequest:
return errors.NewBadParameterErrorFromString(responseBody)
case http.StatusConflict:
return errors.NewData... | [
"func",
"ConvertHTTPErrorCode",
"(",
"statusCode",
"int",
",",
"responseBody",
"string",
")",
"error",
"{",
"switch",
"statusCode",
"{",
"case",
"http",
".",
"StatusNotFound",
":",
"return",
"errors",
".",
"NewNotFoundErrorFromString",
"(",
"responseBody",
")",
"\... | // ConvertHTTPErrorCode converts an http status code to an instance of type error | [
"ConvertHTTPErrorCode",
"converts",
"an",
"http",
"status",
"code",
"to",
"an",
"instance",
"of",
"type",
"error"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/rest/proxy/error.go#L9-L31 |
135,507 | fabric8-services/fabric8-wit | token/token.go | NewManager | func NewManager(config tokenManagerConfiguration) (Manager, error) {
// Load public keys from Auth service and add them to the manager
tm := &tokenManager{
publicKeysMap: map[string]*rsa.PublicKey{},
}
keysEndpoint := fmt.Sprintf("%s%s", config.GetAuthServiceURL(), authservice.KeysTokenPath())
remoteKeys, err :... | go | func NewManager(config tokenManagerConfiguration) (Manager, error) {
// Load public keys from Auth service and add them to the manager
tm := &tokenManager{
publicKeysMap: map[string]*rsa.PublicKey{},
}
keysEndpoint := fmt.Sprintf("%s%s", config.GetAuthServiceURL(), authservice.KeysTokenPath())
remoteKeys, err :... | [
"func",
"NewManager",
"(",
"config",
"tokenManagerConfiguration",
")",
"(",
"Manager",
",",
"error",
")",
"{",
"// Load public keys from Auth service and add them to the manager",
"tm",
":=",
"&",
"tokenManager",
"{",
"publicKeysMap",
":",
"map",
"[",
"string",
"]",
"... | // NewManager returns a new token Manager for handling tokens | [
"NewManager",
"returns",
"a",
"new",
"token",
"Manager",
"for",
"handling",
"tokens"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/token/token.go#L70-L123 |
135,508 | fabric8-services/fabric8-wit | token/token.go | NewManagerWithPublicKey | func NewManagerWithPublicKey(id string, key *rsa.PublicKey) Manager {
return &tokenManager{
publicKeysMap: map[string]*rsa.PublicKey{id: key},
publicKeys: []*PublicKey{{KeyID: id, Key: key}},
}
} | go | func NewManagerWithPublicKey(id string, key *rsa.PublicKey) Manager {
return &tokenManager{
publicKeysMap: map[string]*rsa.PublicKey{id: key},
publicKeys: []*PublicKey{{KeyID: id, Key: key}},
}
} | [
"func",
"NewManagerWithPublicKey",
"(",
"id",
"string",
",",
"key",
"*",
"rsa",
".",
"PublicKey",
")",
"Manager",
"{",
"return",
"&",
"tokenManager",
"{",
"publicKeysMap",
":",
"map",
"[",
"string",
"]",
"*",
"rsa",
".",
"PublicKey",
"{",
"id",
":",
"key... | // NewManagerWithPublicKey returns a new token Manager for handling tokens with the only public key | [
"NewManagerWithPublicKey",
"returns",
"a",
"new",
"token",
"Manager",
"for",
"handling",
"tokens",
"with",
"the",
"only",
"public",
"key"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/token/token.go#L126-L131 |
135,509 | fabric8-services/fabric8-wit | token/token.go | ParseToken | func (mgm *tokenManager) ParseToken(ctx context.Context, tokenString string) (*TokenClaims, error) {
token, err := jwt.ParseWithClaims(tokenString, &TokenClaims{}, func(token *jwt.Token) (interface{}, error) {
kid, ok := token.Header["kid"]
if !ok {
log.Error(ctx, map[string]interface{}{}, "There is no 'kid' he... | go | func (mgm *tokenManager) ParseToken(ctx context.Context, tokenString string) (*TokenClaims, error) {
token, err := jwt.ParseWithClaims(tokenString, &TokenClaims{}, func(token *jwt.Token) (interface{}, error) {
kid, ok := token.Header["kid"]
if !ok {
log.Error(ctx, map[string]interface{}{}, "There is no 'kid' he... | [
"func",
"(",
"mgm",
"*",
"tokenManager",
")",
"ParseToken",
"(",
"ctx",
"context",
".",
"Context",
",",
"tokenString",
"string",
")",
"(",
"*",
"TokenClaims",
",",
"error",
")",
"{",
"token",
",",
"err",
":=",
"jwt",
".",
"ParseWithClaims",
"(",
"tokenSt... | // ParseToken parses token claims | [
"ParseToken",
"parses",
"token",
"claims"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/token/token.go#L149-L173 |
135,510 | fabric8-services/fabric8-wit | token/token.go | CheckClaims | func CheckClaims(claims *TokenClaims) error {
if claims.Subject == "" {
return errors.New("subject claim not found in token")
}
_, err := uuid.FromString(claims.Subject)
if err != nil {
return errors.New("subject claim from token is not UUID " + err.Error())
}
if claims.Username == "" {
return errors.New("u... | go | func CheckClaims(claims *TokenClaims) error {
if claims.Subject == "" {
return errors.New("subject claim not found in token")
}
_, err := uuid.FromString(claims.Subject)
if err != nil {
return errors.New("subject claim from token is not UUID " + err.Error())
}
if claims.Username == "" {
return errors.New("u... | [
"func",
"CheckClaims",
"(",
"claims",
"*",
"TokenClaims",
")",
"error",
"{",
"if",
"claims",
".",
"Subject",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"_",
",",
"err",
":=",
"uuid",
".",
"FromStri... | // CheckClaims checks if all the required claims are present in the access token | [
"CheckClaims",
"checks",
"if",
"all",
"the",
"required",
"claims",
"are",
"present",
"in",
"the",
"access",
"token"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/token/token.go#L206-L221 |
135,511 | fabric8-services/fabric8-wit | token/token.go | ReadManagerFromContext | func ReadManagerFromContext(ctx context.Context) (*Manager, error) {
tm := tokencontext.ReadTokenManagerFromContext(ctx)
if tm == nil {
log.Error(ctx, map[string]interface{}{
"token": tm,
}, "missing token manager")
return nil, errors.New("Missing token manager")
}
tokenManager := tm.(Manager)
return &to... | go | func ReadManagerFromContext(ctx context.Context) (*Manager, error) {
tm := tokencontext.ReadTokenManagerFromContext(ctx)
if tm == nil {
log.Error(ctx, map[string]interface{}{
"token": tm,
}, "missing token manager")
return nil, errors.New("Missing token manager")
}
tokenManager := tm.(Manager)
return &to... | [
"func",
"ReadManagerFromContext",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"*",
"Manager",
",",
"error",
")",
"{",
"tm",
":=",
"tokencontext",
".",
"ReadTokenManagerFromContext",
"(",
"ctx",
")",
"\n",
"if",
"tm",
"==",
"nil",
"{",
"log",
".",
"E... | // ReadManagerFromContext extracts the token manager from the context | [
"ReadManagerFromContext",
"extracts",
"the",
"token",
"manager",
"from",
"the",
"context"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/token/token.go#L224-L235 |
135,512 | fabric8-services/fabric8-wit | iteration/state.go | CheckValid | func (s State) CheckValid() error {
switch s {
case StateNew, StateStart, StateClose:
return nil
default:
return errors.NewBadParameterError("iteration state", s).Expected(StateNew + "|" + StateStart + "|" + StateClose)
}
} | go | func (s State) CheckValid() error {
switch s {
case StateNew, StateStart, StateClose:
return nil
default:
return errors.NewBadParameterError("iteration state", s).Expected(StateNew + "|" + StateStart + "|" + StateClose)
}
} | [
"func",
"(",
"s",
"State",
")",
"CheckValid",
"(",
")",
"error",
"{",
"switch",
"s",
"{",
"case",
"StateNew",
",",
"StateStart",
",",
"StateClose",
":",
"return",
"nil",
"\n",
"default",
":",
"return",
"errors",
".",
"NewBadParameterError",
"(",
"\"",
"\... | // CheckValid returns nil if the given iteration state is valid; otherwise a
// BadParameterError is returned. | [
"CheckValid",
"returns",
"nil",
"if",
"the",
"given",
"iteration",
"state",
"is",
"valid",
";",
"otherwise",
"a",
"BadParameterError",
"is",
"returned",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/iteration/state.go#L58-L65 |
135,513 | fabric8-services/fabric8-wit | workitem/workitemtype.go | Validate | func (wit WorkItemType) Validate() error {
if strings.TrimSpace(wit.Name) == "" {
return errs.Errorf(`work item type name "%s" when trimmed has a zero-length`, wit.Name)
}
if err := wit.Fields.Validate(); err != nil {
return errs.Wrapf(err, "failed to validate work item type's fields")
}
return nil
} | go | func (wit WorkItemType) Validate() error {
if strings.TrimSpace(wit.Name) == "" {
return errs.Errorf(`work item type name "%s" when trimmed has a zero-length`, wit.Name)
}
if err := wit.Fields.Validate(); err != nil {
return errs.Wrapf(err, "failed to validate work item type's fields")
}
return nil
} | [
"func",
"(",
"wit",
"WorkItemType",
")",
"Validate",
"(",
")",
"error",
"{",
"if",
"strings",
".",
"TrimSpace",
"(",
"wit",
".",
"Name",
")",
"==",
"\"",
"\"",
"{",
"return",
"errs",
".",
"Errorf",
"(",
"`work item type name \"%s\" when trimmed has a zero-leng... | // Validate runs some checks on the work item type to ensure the field
// definitions make sense. | [
"Validate",
"runs",
"some",
"checks",
"on",
"the",
"work",
"item",
"type",
"to",
"ensure",
"the",
"field",
"definitions",
"make",
"sense",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype.go#L120-L128 |
135,514 | fabric8-services/fabric8-wit | workitem/workitemtype.go | strPtrIsNilOrContentIsEqual | func strPtrIsNilOrContentIsEqual(l, r *string) bool {
if l == nil && r != nil {
return false
}
if l != nil && r == nil {
return false
}
if l == nil && r == nil {
return true
}
return *l == *r
} | go | func strPtrIsNilOrContentIsEqual(l, r *string) bool {
if l == nil && r != nil {
return false
}
if l != nil && r == nil {
return false
}
if l == nil && r == nil {
return true
}
return *l == *r
} | [
"func",
"strPtrIsNilOrContentIsEqual",
"(",
"l",
",",
"r",
"*",
"string",
")",
"bool",
"{",
"if",
"l",
"==",
"nil",
"&&",
"r",
"!=",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"l",
"!=",
"nil",
"&&",
"r",
"==",
"nil",
"{",
"return",
"f... | // returns true if the left hand and right hand side string
// pointers either both point to nil or reference the same
// content; otherwise false is returned. | [
"returns",
"true",
"if",
"the",
"left",
"hand",
"and",
"right",
"hand",
"side",
"string",
"pointers",
"either",
"both",
"point",
"to",
"nil",
"or",
"reference",
"the",
"same",
"content",
";",
"otherwise",
"false",
"is",
"returned",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype.go#L159-L170 |
135,515 | fabric8-services/fabric8-wit | workitem/workitemtype.go | Equal | func (wit WorkItemType) Equal(u convert.Equaler) bool {
other, ok := u.(WorkItemType)
if !ok {
return false
}
if wit.ID != other.ID {
return false
}
if !convert.CascadeEqual(wit.Lifecycle, other.Lifecycle) {
return false
}
if wit.Version != other.Version {
return false
}
if wit.Name != other.Name {
... | go | func (wit WorkItemType) Equal(u convert.Equaler) bool {
other, ok := u.(WorkItemType)
if !ok {
return false
}
if wit.ID != other.ID {
return false
}
if !convert.CascadeEqual(wit.Lifecycle, other.Lifecycle) {
return false
}
if wit.Version != other.Version {
return false
}
if wit.Name != other.Name {
... | [
"func",
"(",
"wit",
"WorkItemType",
")",
"Equal",
"(",
"u",
"convert",
".",
"Equaler",
")",
"bool",
"{",
"other",
",",
"ok",
":=",
"u",
".",
"(",
"WorkItemType",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"wit",
".... | // Equal returns true if two WorkItemType objects are equal; otherwise false is returned. | [
"Equal",
"returns",
"true",
"if",
"two",
"WorkItemType",
"objects",
"are",
"equal",
";",
"otherwise",
"false",
"is",
"returned",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype.go#L173-L229 |
135,516 | fabric8-services/fabric8-wit | workitem/workitemtype.go | IsTypeOrSubtypeOf | func (wit WorkItemType) IsTypeOrSubtypeOf(typeID uuid.UUID) bool {
// Check for complete inclusion (e.g. "bar" is contained in "foo.bar.cake")
// and for suffix (e.g. ".cake" is the suffix of "foo.bar.cake").
return uuid.Equal(wit.ID, typeID) || strings.Contains(wit.Path, LtreeSafeID(typeID)+pathSep)
} | go | func (wit WorkItemType) IsTypeOrSubtypeOf(typeID uuid.UUID) bool {
// Check for complete inclusion (e.g. "bar" is contained in "foo.bar.cake")
// and for suffix (e.g. ".cake" is the suffix of "foo.bar.cake").
return uuid.Equal(wit.ID, typeID) || strings.Contains(wit.Path, LtreeSafeID(typeID)+pathSep)
} | [
"func",
"(",
"wit",
"WorkItemType",
")",
"IsTypeOrSubtypeOf",
"(",
"typeID",
"uuid",
".",
"UUID",
")",
"bool",
"{",
"// Check for complete inclusion (e.g. \"bar\" is contained in \"foo.bar.cake\")",
"// and for suffix (e.g. \".cake\" is the suffix of \"foo.bar.cake\").",
"return",
... | // IsTypeOrSubtypeOf returns true if the work item type with the given type ID,
// is of the same type as the current WIT or of it is a subtype; otherwise false
// is returned. | [
"IsTypeOrSubtypeOf",
"returns",
"true",
"if",
"the",
"work",
"item",
"type",
"with",
"the",
"given",
"type",
"ID",
"is",
"of",
"the",
"same",
"type",
"as",
"the",
"current",
"WIT",
"or",
"of",
"it",
"is",
"a",
"subtype",
";",
"otherwise",
"false",
"is",
... | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/workitemtype.go#L272-L276 |
135,517 | fabric8-services/fabric8-wit | path/path.go | This | func (p Path) This() uuid.UUID {
if !p.IsEmpty() {
return p[len(p)-1]
}
return uuid.Nil
} | go | func (p Path) This() uuid.UUID {
if !p.IsEmpty() {
return p[len(p)-1]
}
return uuid.Nil
} | [
"func",
"(",
"p",
"Path",
")",
"This",
"(",
")",
"uuid",
".",
"UUID",
"{",
"if",
"!",
"p",
".",
"IsEmpty",
"(",
")",
"{",
"return",
"p",
"[",
"len",
"(",
"p",
")",
"-",
"1",
"]",
"\n",
"}",
"\n",
"return",
"uuid",
".",
"Nil",
"\n",
"}"
] | // This returns last UUID of slice or uuid.Nil if the path is empty. | [
"This",
"returns",
"last",
"UUID",
"of",
"slice",
"or",
"uuid",
".",
"Nil",
"if",
"the",
"path",
"is",
"empty",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L33-L38 |
135,518 | fabric8-services/fabric8-wit | path/path.go | ParentID | func (p Path) ParentID() uuid.UUID {
if len(p) > 1 {
return p[len(p)-2]
}
return uuid.Nil
} | go | func (p Path) ParentID() uuid.UUID {
if len(p) > 1 {
return p[len(p)-2]
}
return uuid.Nil
} | [
"func",
"(",
"p",
"Path",
")",
"ParentID",
"(",
")",
"uuid",
".",
"UUID",
"{",
"if",
"len",
"(",
"p",
")",
">",
"1",
"{",
"return",
"p",
"[",
"len",
"(",
"p",
")",
"-",
"2",
"]",
"\n",
"}",
"\n",
"return",
"uuid",
".",
"Nil",
"\n",
"}"
] | // ParentID returns UUID before the last one or uuid.Nil if this was already the
// parent. | [
"ParentID",
"returns",
"UUID",
"before",
"the",
"last",
"one",
"or",
"uuid",
".",
"Nil",
"if",
"this",
"was",
"already",
"the",
"parent",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L42-L47 |
135,519 | fabric8-services/fabric8-wit | path/path.go | ParentPath | func (p Path) ParentPath() Path {
if len(p) > 1 {
return p[:len(p)-1]
}
return Path{}
} | go | func (p Path) ParentPath() Path {
if len(p) > 1 {
return p[:len(p)-1]
}
return Path{}
} | [
"func",
"(",
"p",
"Path",
")",
"ParentPath",
"(",
")",
"Path",
"{",
"if",
"len",
"(",
"p",
")",
">",
"1",
"{",
"return",
"p",
"[",
":",
"len",
"(",
"p",
")",
"-",
"1",
"]",
"\n",
"}",
"\n",
"return",
"Path",
"{",
"}",
"\n",
"}"
] | // ParentPath returns the path except this one and an empty path if the path was
// empty. | [
"ParentPath",
"returns",
"the",
"path",
"except",
"this",
"one",
"and",
"an",
"empty",
"path",
"if",
"the",
"path",
"was",
"empty",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L51-L56 |
135,520 | fabric8-services/fabric8-wit | path/path.go | Convert | func (p Path) Convert() string {
if len(p) == 0 {
return ""
}
var op []string
for _, id := range p {
op = append(op, id.String())
}
str := strings.Join(op, SepInDatabase)
return strings.Replace(str, "-", "_", -1)
} | go | func (p Path) Convert() string {
if len(p) == 0 {
return ""
}
var op []string
for _, id := range p {
op = append(op, id.String())
}
str := strings.Join(op, SepInDatabase)
return strings.Replace(str, "-", "_", -1)
} | [
"func",
"(",
"p",
"Path",
")",
"Convert",
"(",
")",
"string",
"{",
"if",
"len",
"(",
"p",
")",
"==",
"0",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"var",
"op",
"[",
"]",
"string",
"\n",
"for",
"_",
",",
"id",
":=",
"range",
"p",
"{",
"op... | // Convert returns ltree compatible string of UUID slice
// 39fa8c5b_5732_436f_a084_0f2a247f3435.87762c8b_17f9_4cbb_b355_251b6a524f2f | [
"Convert",
"returns",
"ltree",
"compatible",
"string",
"of",
"UUID",
"slice",
"39fa8c5b_5732_436f_a084_0f2a247f3435",
".",
"87762c8b_17f9_4cbb_b355_251b6a524f2f"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L60-L70 |
135,521 | fabric8-services/fabric8-wit | path/path.go | Root | func (p Path) Root() Path {
if len(p) > 0 {
return Path{p[0]}
}
return Path{uuid.Nil}
} | go | func (p Path) Root() Path {
if len(p) > 0 {
return Path{p[0]}
}
return Path{uuid.Nil}
} | [
"func",
"(",
"p",
"Path",
")",
"Root",
"(",
")",
"Path",
"{",
"if",
"len",
"(",
"p",
")",
">",
"0",
"{",
"return",
"Path",
"{",
"p",
"[",
"0",
"]",
"}",
"\n",
"}",
"\n",
"return",
"Path",
"{",
"uuid",
".",
"Nil",
"}",
"\n",
"}"
] | // Root retunrs a Path instance with first element in the UUID slice | [
"Root",
"retunrs",
"a",
"Path",
"instance",
"with",
"first",
"element",
"in",
"the",
"UUID",
"slice"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L88-L93 |
135,522 | fabric8-services/fabric8-wit | path/path.go | ConvertToLtree | func ConvertToLtree(id uuid.UUID) string {
converted := strings.Replace(id.String(), "-", "_", -1)
return converted
} | go | func ConvertToLtree(id uuid.UUID) string {
converted := strings.Replace(id.String(), "-", "_", -1)
return converted
} | [
"func",
"ConvertToLtree",
"(",
"id",
"uuid",
".",
"UUID",
")",
"string",
"{",
"converted",
":=",
"strings",
".",
"Replace",
"(",
"id",
".",
"String",
"(",
")",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"-",
"1",
")",
"\n",
"return",
"converted",
"\n",... | // ConvertToLtree returns ltree form of given UUID | [
"ConvertToLtree",
"returns",
"ltree",
"form",
"of",
"given",
"UUID"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L96-L99 |
135,523 | fabric8-services/fabric8-wit | path/path.go | Value | func (p Path) Value() (driver.Value, error) {
op := []string{}
for _, x := range p {
op = append(op, ConvertToLtree(x))
}
s := strings.Join(op, SepInDatabase)
return s, nil
} | go | func (p Path) Value() (driver.Value, error) {
op := []string{}
for _, x := range p {
op = append(op, ConvertToLtree(x))
}
s := strings.Join(op, SepInDatabase)
return s, nil
} | [
"func",
"(",
"p",
"Path",
")",
"Value",
"(",
")",
"(",
"driver",
".",
"Value",
",",
"error",
")",
"{",
"op",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"for",
"_",
",",
"x",
":=",
"range",
"p",
"{",
"op",
"=",
"append",
"(",
"op",
",",
"Conv... | // Value helps in implementing Valuer interfae on Path
// This conversion uses Ltree specification | [
"Value",
"helps",
"in",
"implementing",
"Valuer",
"interfae",
"on",
"Path",
"This",
"conversion",
"uses",
"Ltree",
"specification"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L118-L125 |
135,524 | fabric8-services/fabric8-wit | path/path.go | Scan | func (p *Path) Scan(value interface{}) error {
// if value is nil, false
if value == nil {
*p = []uuid.UUID{}
return nil
}
if str, err := driver.String.ConvertValue(value); err == nil {
// if this is a string type
v := ""
for _, m := range str.([]uint8) {
v += string(m)
}
all, err := p.convertFromL... | go | func (p *Path) Scan(value interface{}) error {
// if value is nil, false
if value == nil {
*p = []uuid.UUID{}
return nil
}
if str, err := driver.String.ConvertValue(value); err == nil {
// if this is a string type
v := ""
for _, m := range str.([]uint8) {
v += string(m)
}
all, err := p.convertFromL... | [
"func",
"(",
"p",
"*",
"Path",
")",
"Scan",
"(",
"value",
"interface",
"{",
"}",
")",
"error",
"{",
"// if value is nil, false",
"if",
"value",
"==",
"nil",
"{",
"*",
"p",
"=",
"[",
"]",
"uuid",
".",
"UUID",
"{",
"}",
"\n",
"return",
"nil",
"\n",
... | // Scan helps in implementing Scanner interface on Path | [
"Scan",
"helps",
"in",
"implementing",
"Scanner",
"interface",
"on",
"Path"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L128-L150 |
135,525 | fabric8-services/fabric8-wit | path/path.go | MarshalJSON | func (p Path) MarshalJSON() ([]byte, error) {
buffer := bytes.NewBufferString("{")
length := len(p)
count := 0
for key, value := range p {
jsonValue, err := json.Marshal(value)
if err != nil {
return nil, err
}
buffer.WriteString(fmt.Sprintf("\"%d\":%s", key, string(jsonValue)))
count++
if count < le... | go | func (p Path) MarshalJSON() ([]byte, error) {
buffer := bytes.NewBufferString("{")
length := len(p)
count := 0
for key, value := range p {
jsonValue, err := json.Marshal(value)
if err != nil {
return nil, err
}
buffer.WriteString(fmt.Sprintf("\"%d\":%s", key, string(jsonValue)))
count++
if count < le... | [
"func",
"(",
"p",
"Path",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"buffer",
":=",
"bytes",
".",
"NewBufferString",
"(",
"\"",
"\"",
")",
"\n",
"length",
":=",
"len",
"(",
"p",
")",
"\n",
"count",
":=",
"0",
... | // MarshalJSON allows Path to be serialized | [
"MarshalJSON",
"allows",
"Path",
"to",
"be",
"serialized"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L153-L170 |
135,526 | fabric8-services/fabric8-wit | path/path.go | UnmarshalJSON | func (p *Path) UnmarshalJSON(b []byte) error {
var stringMap map[string]string
err := json.Unmarshal(b, &stringMap)
if err != nil {
return err
}
for _, value := range stringMap {
id, err := uuid.FromString(value)
if err != nil {
return err
}
*p = append(*p, id)
}
return nil
} | go | func (p *Path) UnmarshalJSON(b []byte) error {
var stringMap map[string]string
err := json.Unmarshal(b, &stringMap)
if err != nil {
return err
}
for _, value := range stringMap {
id, err := uuid.FromString(value)
if err != nil {
return err
}
*p = append(*p, id)
}
return nil
} | [
"func",
"(",
"p",
"*",
"Path",
")",
"UnmarshalJSON",
"(",
"b",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"stringMap",
"map",
"[",
"string",
"]",
"string",
"\n",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"b",
",",
"&",
"stringMap",
")",
"\n",
... | // UnmarshalJSON allows Path to be deserialized | [
"UnmarshalJSON",
"allows",
"Path",
"to",
"be",
"deserialized"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L173-L187 |
135,527 | fabric8-services/fabric8-wit | path/path.go | ToExpression | func ToExpression(p Path, this uuid.UUID) string {
converted := strings.Replace(this.String(), "-", "_", -1)
existingPath := p.Convert()
if existingPath == "" {
return converted
}
return fmt.Sprintf("%s.%s", p.Convert(), converted)
} | go | func ToExpression(p Path, this uuid.UUID) string {
converted := strings.Replace(this.String(), "-", "_", -1)
existingPath := p.Convert()
if existingPath == "" {
return converted
}
return fmt.Sprintf("%s.%s", p.Convert(), converted)
} | [
"func",
"ToExpression",
"(",
"p",
"Path",
",",
"this",
"uuid",
".",
"UUID",
")",
"string",
"{",
"converted",
":=",
"strings",
".",
"Replace",
"(",
"this",
".",
"String",
"(",
")",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"-",
"1",
")",
"\n",
"exist... | // ToExpression returns a string in ltree format.
// Joins UUIDs in the first argument using `.`
// Second argument is converted and appended if needed | [
"ToExpression",
"returns",
"a",
"string",
"in",
"ltree",
"format",
".",
"Joins",
"UUIDs",
"in",
"the",
"first",
"argument",
"using",
".",
"Second",
"argument",
"is",
"converted",
"and",
"appended",
"if",
"needed"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/path/path.go#L192-L199 |
135,528 | fabric8-services/fabric8-wit | design/workitems.go | Reorder | func Reorder(name, description string, data *d.UserTypeDefinition, position *d.UserTypeDefinition) *d.MediaTypeDefinition {
return a.MediaType("application/vnd."+strings.ToLower(name)+"json", func() {
a.UseTrait("jsonapi-media-type")
a.TypeName(name + "Reorder")
a.Description(description)
a.Attribute("data", a... | go | func Reorder(name, description string, data *d.UserTypeDefinition, position *d.UserTypeDefinition) *d.MediaTypeDefinition {
return a.MediaType("application/vnd."+strings.ToLower(name)+"json", func() {
a.UseTrait("jsonapi-media-type")
a.TypeName(name + "Reorder")
a.Description(description)
a.Attribute("data", a... | [
"func",
"Reorder",
"(",
"name",
",",
"description",
"string",
",",
"data",
"*",
"d",
".",
"UserTypeDefinition",
",",
"position",
"*",
"d",
".",
"UserTypeDefinition",
")",
"*",
"d",
".",
"MediaTypeDefinition",
"{",
"return",
"a",
".",
"MediaType",
"(",
"\""... | // Reorder creates a UserTypeDefinition for Reorder action | [
"Reorder",
"creates",
"a",
"UserTypeDefinition",
"for",
"Reorder",
"action"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/design/workitems.go#L89-L101 |
135,529 | fabric8-services/fabric8-wit | controller/work_item_type_groups.go | NewWorkItemTypeGroupsController | func NewWorkItemTypeGroupsController(service *goa.Service, db application.DB) *WorkItemTypeGroupsController {
return &WorkItemTypeGroupsController{
Controller: service.NewController("WorkItemTypeGroupsController"),
db: db,
}
} | go | func NewWorkItemTypeGroupsController(service *goa.Service, db application.DB) *WorkItemTypeGroupsController {
return &WorkItemTypeGroupsController{
Controller: service.NewController("WorkItemTypeGroupsController"),
db: db,
}
} | [
"func",
"NewWorkItemTypeGroupsController",
"(",
"service",
"*",
"goa",
".",
"Service",
",",
"db",
"application",
".",
"DB",
")",
"*",
"WorkItemTypeGroupsController",
"{",
"return",
"&",
"WorkItemTypeGroupsController",
"{",
"Controller",
":",
"service",
".",
"NewCont... | // NewWorkItemTypeGroupsController creates a work_item_type_groups controller. | [
"NewWorkItemTypeGroupsController",
"creates",
"a",
"work_item_type_groups",
"controller",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/work_item_type_groups.go#L20-L25 |
135,530 | fabric8-services/fabric8-wit | controller/tracker.go | NewTrackerController | func NewTrackerController(service *goa.Service, db application.DB, scheduler *remoteworkitem.Scheduler, configuration trackerConfiguration) *TrackerController {
return &TrackerController{
Controller: service.NewController("TrackerController"),
db: db,
scheduler: scheduler,
configuration: conf... | go | func NewTrackerController(service *goa.Service, db application.DB, scheduler *remoteworkitem.Scheduler, configuration trackerConfiguration) *TrackerController {
return &TrackerController{
Controller: service.NewController("TrackerController"),
db: db,
scheduler: scheduler,
configuration: conf... | [
"func",
"NewTrackerController",
"(",
"service",
"*",
"goa",
".",
"Service",
",",
"db",
"application",
".",
"DB",
",",
"scheduler",
"*",
"remoteworkitem",
".",
"Scheduler",
",",
"configuration",
"trackerConfiguration",
")",
"*",
"TrackerController",
"{",
"return",
... | // NewTrackerController creates a tracker controller. | [
"NewTrackerController",
"creates",
"a",
"tracker",
"controller",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/tracker.go#L38-L44 |
135,531 | fabric8-services/fabric8-wit | controller/tracker.go | ConvertTrackers | func ConvertTrackers(request *http.Request, trackers []remoteworkitem.Tracker) []*app.Tracker {
var ls = []*app.Tracker{}
for _, i := range trackers {
ls = append(ls, ConvertTracker(request, i))
}
return ls
} | go | func ConvertTrackers(request *http.Request, trackers []remoteworkitem.Tracker) []*app.Tracker {
var ls = []*app.Tracker{}
for _, i := range trackers {
ls = append(ls, ConvertTracker(request, i))
}
return ls
} | [
"func",
"ConvertTrackers",
"(",
"request",
"*",
"http",
".",
"Request",
",",
"trackers",
"[",
"]",
"remoteworkitem",
".",
"Tracker",
")",
"[",
"]",
"*",
"app",
".",
"Tracker",
"{",
"var",
"ls",
"=",
"[",
"]",
"*",
"app",
".",
"Tracker",
"{",
"}",
"... | // ConvertTrackers from internal to external REST representation | [
"ConvertTrackers",
"from",
"internal",
"to",
"external",
"REST",
"representation"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/tracker.go#L137-L143 |
135,532 | fabric8-services/fabric8-wit | controller/tracker.go | ConvertTracker | func ConvertTracker(request *http.Request, tracker remoteworkitem.Tracker) *app.Tracker {
trackerStringType := remoteworkitem.APIStringTypeTrackers
selfURL := rest.AbsoluteURL(request, app.TrackerHref(tracker.ID))
t := &app.Tracker{
Type: trackerStringType,
ID: &tracker.ID,
Attributes: &app.TrackerAttributes... | go | func ConvertTracker(request *http.Request, tracker remoteworkitem.Tracker) *app.Tracker {
trackerStringType := remoteworkitem.APIStringTypeTrackers
selfURL := rest.AbsoluteURL(request, app.TrackerHref(tracker.ID))
t := &app.Tracker{
Type: trackerStringType,
ID: &tracker.ID,
Attributes: &app.TrackerAttributes... | [
"func",
"ConvertTracker",
"(",
"request",
"*",
"http",
".",
"Request",
",",
"tracker",
"remoteworkitem",
".",
"Tracker",
")",
"*",
"app",
".",
"Tracker",
"{",
"trackerStringType",
":=",
"remoteworkitem",
".",
"APIStringTypeTrackers",
"\n",
"selfURL",
":=",
"rest... | // ConvertTracker converts from internal to external REST representation | [
"ConvertTracker",
"converts",
"from",
"internal",
"to",
"external",
"REST",
"representation"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/tracker.go#L179-L194 |
135,533 | fabric8-services/fabric8-wit | controller/filter.go | NewFilterController | func NewFilterController(service *goa.Service, config FilterControllerConfiguration) *FilterController {
return &FilterController{
Controller: service.NewController("FilterController"),
config: config,
}
} | go | func NewFilterController(service *goa.Service, config FilterControllerConfiguration) *FilterController {
return &FilterController{
Controller: service.NewController("FilterController"),
config: config,
}
} | [
"func",
"NewFilterController",
"(",
"service",
"*",
"goa",
".",
"Service",
",",
"config",
"FilterControllerConfiguration",
")",
"*",
"FilterController",
"{",
"return",
"&",
"FilterController",
"{",
"Controller",
":",
"service",
".",
"NewController",
"(",
"\"",
"\"... | // NewFilterController creates a filter controller. | [
"NewFilterController",
"creates",
"a",
"filter",
"controller",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/filter.go#L25-L30 |
135,534 | fabric8-services/fabric8-wit | sentry/sentry.go | WithEnvironment | func WithEnvironment(env string) func(*client) {
return func(c *client) {
c.c.SetEnvironment(env)
}
} | go | func WithEnvironment(env string) func(*client) {
return func(c *client) {
c.c.SetEnvironment(env)
}
} | [
"func",
"WithEnvironment",
"(",
"env",
"string",
")",
"func",
"(",
"*",
"client",
")",
"{",
"return",
"func",
"(",
"c",
"*",
"client",
")",
"{",
"c",
".",
"c",
".",
"SetEnvironment",
"(",
"env",
")",
"\n",
"}",
"\n",
"}"
] | // WithEnvironment helps you set environment the deployed code is
// running in while initializing sentry client using function
// InitializeSentryClient | [
"WithEnvironment",
"helps",
"you",
"set",
"environment",
"the",
"deployed",
"code",
"is",
"running",
"in",
"while",
"initializing",
"sentry",
"client",
"using",
"function",
"InitializeSentryClient"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/sentry/sentry.go#L65-L69 |
135,535 | fabric8-services/fabric8-wit | sentry/sentry.go | CaptureError | func (c *client) CaptureError(ctx context.Context, err error) {
// if method called during test which has uninitialized client
if c == nil {
return
}
// Extract user information. Ignoring error here but then before using the
// object user make sure to check if it wasn't nil.
user, _ := extractUserInfo(ctx)
re... | go | func (c *client) CaptureError(ctx context.Context, err error) {
// if method called during test which has uninitialized client
if c == nil {
return
}
// Extract user information. Ignoring error here but then before using the
// object user make sure to check if it wasn't nil.
user, _ := extractUserInfo(ctx)
re... | [
"func",
"(",
"c",
"*",
"client",
")",
"CaptureError",
"(",
"ctx",
"context",
".",
"Context",
",",
"err",
"error",
")",
"{",
"// if method called during test which has uninitialized client",
"if",
"c",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"// Extract user... | // CaptureError sends error 'err' to Sentry, meanwhile also sets user
// information by extracting user information from the context provided | [
"CaptureError",
"sends",
"error",
"err",
"to",
"Sentry",
"meanwhile",
"also",
"sets",
"user",
"information",
"by",
"extracting",
"user",
"information",
"from",
"the",
"context",
"provided"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/sentry/sentry.go#L81-L104 |
135,536 | fabric8-services/fabric8-wit | sentry/sentry.go | extractUserInfo | func extractUserInfo(ctx context.Context) (*raven.User, error) {
m, err := token.ReadManagerFromContext(ctx)
if err != nil {
return nil, err
}
q := *m
token := goajwt.ContextJWT(ctx)
if token == nil {
return nil, fmt.Errorf("no token found in context")
}
t, err := q.ParseToken(ctx, token.Raw)
if err != ni... | go | func extractUserInfo(ctx context.Context) (*raven.User, error) {
m, err := token.ReadManagerFromContext(ctx)
if err != nil {
return nil, err
}
q := *m
token := goajwt.ContextJWT(ctx)
if token == nil {
return nil, fmt.Errorf("no token found in context")
}
t, err := q.ParseToken(ctx, token.Raw)
if err != ni... | [
"func",
"extractUserInfo",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"*",
"raven",
".",
"User",
",",
"error",
")",
"{",
"m",
",",
"err",
":=",
"token",
".",
"ReadManagerFromContext",
"(",
"ctx",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"retur... | // extractUserInfo reads the context and returns sentry understandable
// user object's reference and error | [
"extractUserInfo",
"reads",
"the",
"context",
"and",
"returns",
"sentry",
"understandable",
"user",
"object",
"s",
"reference",
"and",
"error"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/sentry/sentry.go#L108-L129 |
135,537 | fabric8-services/fabric8-wit | spacetemplate/importer/repository.go | checkNoWITIsMissing | func (r *GormRepository) checkNoWITIsMissing(ctx context.Context, s *ImportHelper) error {
type idType struct {
ID uuid.UUID `gorm:"column:id" sql:"type:uuid"`
}
var IDs []idType
query := fmt.Sprintf(`SELECT id FROM "%s" WHERE space_template_id = ?`, workitem.WorkItemType{}.TableName())
db := r.db.Raw(query, s.T... | go | func (r *GormRepository) checkNoWITIsMissing(ctx context.Context, s *ImportHelper) error {
type idType struct {
ID uuid.UUID `gorm:"column:id" sql:"type:uuid"`
}
var IDs []idType
query := fmt.Sprintf(`SELECT id FROM "%s" WHERE space_template_id = ?`, workitem.WorkItemType{}.TableName())
db := r.db.Raw(query, s.T... | [
"func",
"(",
"r",
"*",
"GormRepository",
")",
"checkNoWITIsMissing",
"(",
"ctx",
"context",
".",
"Context",
",",
"s",
"*",
"ImportHelper",
")",
"error",
"{",
"type",
"idType",
"struct",
"{",
"ID",
"uuid",
".",
"UUID",
"`gorm:\"column:id\" sql:\"type:uuid\"`",
... | // checkNoWITIsMissing returns an error if currently imported work item types
// are missing already existing work item types. | [
"checkNoWITIsMissing",
"returns",
"an",
"error",
"if",
"currently",
"imported",
"work",
"item",
"types",
"are",
"missing",
"already",
"existing",
"work",
"item",
"types",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/repository.go#L242-L263 |
135,538 | fabric8-services/fabric8-wit | spacetemplate/importer/repository.go | checkNoWILTIsMissing | func (r *GormRepository) checkNoWILTIsMissing(ctx context.Context, s *ImportHelper) error {
type idType struct {
ID uuid.UUID `gorm:"column:id" sql:"type:uuid"`
}
var IDs []idType
query := fmt.Sprintf(`SELECT id FROM "%s" WHERE space_template_id = ?`, link.WorkItemLinkType{}.TableName())
db := r.db.Raw(query, s.... | go | func (r *GormRepository) checkNoWILTIsMissing(ctx context.Context, s *ImportHelper) error {
type idType struct {
ID uuid.UUID `gorm:"column:id" sql:"type:uuid"`
}
var IDs []idType
query := fmt.Sprintf(`SELECT id FROM "%s" WHERE space_template_id = ?`, link.WorkItemLinkType{}.TableName())
db := r.db.Raw(query, s.... | [
"func",
"(",
"r",
"*",
"GormRepository",
")",
"checkNoWILTIsMissing",
"(",
"ctx",
"context",
".",
"Context",
",",
"s",
"*",
"ImportHelper",
")",
"error",
"{",
"type",
"idType",
"struct",
"{",
"ID",
"uuid",
".",
"UUID",
"`gorm:\"column:id\" sql:\"type:uuid\"`",
... | // checkNoWILTIsMissing returns an error if currently imported work item link
// types are missing already existing work item link types. | [
"checkNoWILTIsMissing",
"returns",
"an",
"error",
"if",
"currently",
"imported",
"work",
"item",
"link",
"types",
"are",
"missing",
"already",
"existing",
"work",
"item",
"link",
"types",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/spacetemplate/importer/repository.go#L304-L325 |
135,539 | fabric8-services/fabric8-wit | controller/named_work_items.go | NewNamedWorkItemsController | func NewNamedWorkItemsController(service *goa.Service, db application.DB) *NamedWorkItemsController {
return &NamedWorkItemsController{
Controller: service.NewController("NamedWorkItemsController"),
db: db,
}
} | go | func NewNamedWorkItemsController(service *goa.Service, db application.DB) *NamedWorkItemsController {
return &NamedWorkItemsController{
Controller: service.NewController("NamedWorkItemsController"),
db: db,
}
} | [
"func",
"NewNamedWorkItemsController",
"(",
"service",
"*",
"goa",
".",
"Service",
",",
"db",
"application",
".",
"DB",
")",
"*",
"NamedWorkItemsController",
"{",
"return",
"&",
"NamedWorkItemsController",
"{",
"Controller",
":",
"service",
".",
"NewController",
"... | // NewNamedWorkItemsController creates a named_work_items controller. | [
"NewNamedWorkItemsController",
"creates",
"a",
"named_work_items",
"controller",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/controller/named_work_items.go#L19-L24 |
135,540 | fabric8-services/fabric8-wit | workitem/list_type.go | SetDefaultValue | func (t ListType) SetDefaultValue(v interface{}) (FieldType, error) {
if v == nil {
t.DefaultValue = nil
return t, nil
}
defVal, err := t.ComponentType.ConvertToModel(v)
if err != nil {
return nil, errs.Wrapf(err, "failed to set default value of list type to %+v (%[1]T)", v)
}
t.DefaultValue = defVal
retur... | go | func (t ListType) SetDefaultValue(v interface{}) (FieldType, error) {
if v == nil {
t.DefaultValue = nil
return t, nil
}
defVal, err := t.ComponentType.ConvertToModel(v)
if err != nil {
return nil, errs.Wrapf(err, "failed to set default value of list type to %+v (%[1]T)", v)
}
t.DefaultValue = defVal
retur... | [
"func",
"(",
"t",
"ListType",
")",
"SetDefaultValue",
"(",
"v",
"interface",
"{",
"}",
")",
"(",
"FieldType",
",",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"t",
".",
"DefaultValue",
"=",
"nil",
"\n",
"return",
"t",
",",
"nil",
"\n",
"}",
"... | // SetDefaultValue implements FieldType | [
"SetDefaultValue",
"implements",
"FieldType"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/list_type.go#L44-L55 |
135,541 | fabric8-services/fabric8-wit | workitem/list_type.go | Equal | func (t ListType) Equal(u convert.Equaler) bool {
other, ok := u.(ListType)
if !ok {
return false
}
if !convert.CascadeEqual(t.SimpleType, other.SimpleType) {
return false
}
if !reflect.DeepEqual(t.DefaultValue, other.DefaultValue) {
return false
}
return convert.CascadeEqual(t.ComponentType, other.Compon... | go | func (t ListType) Equal(u convert.Equaler) bool {
other, ok := u.(ListType)
if !ok {
return false
}
if !convert.CascadeEqual(t.SimpleType, other.SimpleType) {
return false
}
if !reflect.DeepEqual(t.DefaultValue, other.DefaultValue) {
return false
}
return convert.CascadeEqual(t.ComponentType, other.Compon... | [
"func",
"(",
"t",
"ListType",
")",
"Equal",
"(",
"u",
"convert",
".",
"Equaler",
")",
"bool",
"{",
"other",
",",
"ok",
":=",
"u",
".",
"(",
"ListType",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"convert",
"... | // Equal returns true if two ListType objects are equal; otherwise false is returned. | [
"Equal",
"returns",
"true",
"if",
"two",
"ListType",
"objects",
"are",
"equal",
";",
"otherwise",
"false",
"is",
"returned",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/list_type.go#L63-L75 |
135,542 | fabric8-services/fabric8-wit | workitem/link/link_repository.go | NewWorkItemLinkRepository | func NewWorkItemLinkRepository(db *gorm.DB) *GormWorkItemLinkRepository {
return &GormWorkItemLinkRepository{
db: db,
workItemRepo: workitem.NewWorkItemRepository(db),
workItemTypeRepo: workitem.NewWorkItemTypeRepository(db),
workItemLinkTypeRepo: NewWorkItemLinkTypeRepository(db)... | go | func NewWorkItemLinkRepository(db *gorm.DB) *GormWorkItemLinkRepository {
return &GormWorkItemLinkRepository{
db: db,
workItemRepo: workitem.NewWorkItemRepository(db),
workItemTypeRepo: workitem.NewWorkItemTypeRepository(db),
workItemLinkTypeRepo: NewWorkItemLinkTypeRepository(db)... | [
"func",
"NewWorkItemLinkRepository",
"(",
"db",
"*",
"gorm",
".",
"DB",
")",
"*",
"GormWorkItemLinkRepository",
"{",
"return",
"&",
"GormWorkItemLinkRepository",
"{",
"db",
":",
"db",
",",
"workItemRepo",
":",
"workitem",
".",
"NewWorkItemRepository",
"(",
"db",
... | // NewWorkItemLinkRepository creates a work item link repository based on gorm | [
"NewWorkItemLinkRepository",
"creates",
"a",
"work",
"item",
"link",
"repository",
"based",
"on",
"gorm"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/link_repository.go#L51-L59 |
135,543 | fabric8-services/fabric8-wit | workitem/link/link_repository.go | HasParent | func (r *GormWorkItemLinkRepository) HasParent(ctx context.Context, childID uuid.UUID, linkType WorkItemLinkType) (bool, error) {
var row *sql.Row
query := fmt.Sprintf(`
SELECT EXISTS (
SELECT 1 FROM %[1]s
WHERE
link_type_id=$1
AND target_id=$2
AND deleted_at IS NULL
)`, WorkItemLink{}.TableName... | go | func (r *GormWorkItemLinkRepository) HasParent(ctx context.Context, childID uuid.UUID, linkType WorkItemLinkType) (bool, error) {
var row *sql.Row
query := fmt.Sprintf(`
SELECT EXISTS (
SELECT 1 FROM %[1]s
WHERE
link_type_id=$1
AND target_id=$2
AND deleted_at IS NULL
)`, WorkItemLink{}.TableName... | [
"func",
"(",
"r",
"*",
"GormWorkItemLinkRepository",
")",
"HasParent",
"(",
"ctx",
"context",
".",
"Context",
",",
"childID",
"uuid",
".",
"UUID",
",",
"linkType",
"WorkItemLinkType",
")",
"(",
"bool",
",",
"error",
")",
"{",
"var",
"row",
"*",
"sql",
".... | // HasParent returns `true` if a link to a work item with the given `childID`
// and of the given `linkType` already exists; `false` otherwise. | [
"HasParent",
"returns",
"true",
"if",
"a",
"link",
"to",
"a",
"work",
"item",
"with",
"the",
"given",
"childID",
"and",
"of",
"the",
"given",
"linkType",
"already",
"exists",
";",
"false",
"otherwise",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/link_repository.go#L72-L88 |
135,544 | fabric8-services/fabric8-wit | workitem/link/link_repository.go | ValidateTopology | func (r *GormWorkItemLinkRepository) ValidateTopology(ctx context.Context, sourceID uuid.UUID, targetID uuid.UUID, linkType WorkItemLinkType) error {
// check to disallow multiple parents in tree topology
if linkType.Topology == TopologyTree {
parentExists, err := r.HasParent(ctx, targetID, linkType)
if err != ni... | go | func (r *GormWorkItemLinkRepository) ValidateTopology(ctx context.Context, sourceID uuid.UUID, targetID uuid.UUID, linkType WorkItemLinkType) error {
// check to disallow multiple parents in tree topology
if linkType.Topology == TopologyTree {
parentExists, err := r.HasParent(ctx, targetID, linkType)
if err != ni... | [
"func",
"(",
"r",
"*",
"GormWorkItemLinkRepository",
")",
"ValidateTopology",
"(",
"ctx",
"context",
".",
"Context",
",",
"sourceID",
"uuid",
".",
"UUID",
",",
"targetID",
"uuid",
".",
"UUID",
",",
"linkType",
"WorkItemLinkType",
")",
"error",
"{",
"// check t... | // ValidateTopology validates the link topology of the work item given its ID. I.e, the given item should not have a parent with the same kind of link
// if the `sourceID` arg is not empty, then the corresponding source item is ignored when checking the existing links of the given type. | [
"ValidateTopology",
"validates",
"the",
"link",
"topology",
"of",
"the",
"work",
"item",
"given",
"its",
"ID",
".",
"I",
".",
"e",
"the",
"given",
"item",
"should",
"not",
"have",
"a",
"parent",
"with",
"the",
"same",
"kind",
"of",
"link",
"if",
"the",
... | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/link_repository.go#L92-L124 |
135,545 | fabric8-services/fabric8-wit | workitem/link/link_repository.go | acquireLock | func (r *GormWorkItemLinkRepository) acquireLock(spaceID uuid.UUID) error {
// hash the UUID to get a 32 bit value from a 128 UUID that we can then use
// with a PostgreSQL advisory lock.
//
// TODO(kwk): Reducing the 128 bit UUID to a 32 bit number potentially ends
// up in longer wait times for locks because the... | go | func (r *GormWorkItemLinkRepository) acquireLock(spaceID uuid.UUID) error {
// hash the UUID to get a 32 bit value from a 128 UUID that we can then use
// with a PostgreSQL advisory lock.
//
// TODO(kwk): Reducing the 128 bit UUID to a 32 bit number potentially ends
// up in longer wait times for locks because the... | [
"func",
"(",
"r",
"*",
"GormWorkItemLinkRepository",
")",
"acquireLock",
"(",
"spaceID",
"uuid",
".",
"UUID",
")",
"error",
"{",
"// hash the UUID to get a 32 bit value from a 128 UUID that we can then use",
"// with a PostgreSQL advisory lock.",
"//",
"// TODO(kwk): Reducing the... | // acquireLock takes a space ID and acquires an advisory lock. It blocks until
// it acquires the lock. | [
"acquireLock",
"takes",
"a",
"space",
"ID",
"and",
"acquires",
"an",
"advisory",
"lock",
".",
"It",
"blocks",
"until",
"it",
"acquires",
"the",
"lock",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/link_repository.go#L187-L206 |
135,546 | fabric8-services/fabric8-wit | workitem/link/link_repository.go | Load | func (r *GormWorkItemLinkRepository) Load(ctx context.Context, ID uuid.UUID) (*WorkItemLink, error) {
defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "load"}, time.Now())
log.Info(ctx, map[string]interface{}{
"wil_id": ID,
}, "Loading work item link")
result := WorkItemLink{}
db := r.db.Where("id=?"... | go | func (r *GormWorkItemLinkRepository) Load(ctx context.Context, ID uuid.UUID) (*WorkItemLink, error) {
defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "load"}, time.Now())
log.Info(ctx, map[string]interface{}{
"wil_id": ID,
}, "Loading work item link")
result := WorkItemLink{}
db := r.db.Where("id=?"... | [
"func",
"(",
"r",
"*",
"GormWorkItemLinkRepository",
")",
"Load",
"(",
"ctx",
"context",
".",
"Context",
",",
"ID",
"uuid",
".",
"UUID",
")",
"(",
"*",
"WorkItemLink",
",",
"error",
")",
"{",
"defer",
"goa",
".",
"MeasureSince",
"(",
"[",
"]",
"string"... | // Load returns the work item link for the given ID.
// Returns NotFoundError, ConversionError or InternalError | [
"Load",
"returns",
"the",
"work",
"item",
"link",
"for",
"the",
"given",
"ID",
".",
"Returns",
"NotFoundError",
"ConversionError",
"or",
"InternalError"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/link_repository.go#L279-L296 |
135,547 | fabric8-services/fabric8-wit | workitem/link/link_repository.go | DeleteRelatedLinks | func (r *GormWorkItemLinkRepository) DeleteRelatedLinks(ctx context.Context, wiID uuid.UUID, suppressorID uuid.UUID) error {
defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "deleteRelatedLinks"}, time.Now())
log.Info(ctx, map[string]interface{}{
"wi_id": wiID,
}, "Deleting the links related to work it... | go | func (r *GormWorkItemLinkRepository) DeleteRelatedLinks(ctx context.Context, wiID uuid.UUID, suppressorID uuid.UUID) error {
defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "deleteRelatedLinks"}, time.Now())
log.Info(ctx, map[string]interface{}{
"wi_id": wiID,
}, "Deleting the links related to work it... | [
"func",
"(",
"r",
"*",
"GormWorkItemLinkRepository",
")",
"DeleteRelatedLinks",
"(",
"ctx",
"context",
".",
"Context",
",",
"wiID",
"uuid",
".",
"UUID",
",",
"suppressorID",
"uuid",
".",
"UUID",
")",
"error",
"{",
"defer",
"goa",
".",
"MeasureSince",
"(",
... | // DeleteRelatedLinks deletes all links in which the source or target equals the
// given work item ID. | [
"DeleteRelatedLinks",
"deletes",
"all",
"links",
"in",
"which",
"the",
"source",
"or",
"target",
"equals",
"the",
"given",
"work",
"item",
"ID",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/link_repository.go#L358-L382 |
135,548 | fabric8-services/fabric8-wit | workitem/link/link_repository.go | ListChildLinks | func (r *GormWorkItemLinkRepository) ListChildLinks(ctx context.Context, linkTypeID uuid.UUID, parentIDs ...uuid.UUID) (WorkItemLinkList, error) {
defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "list", "children", "ids"}, time.Now())
var results WorkItemLinkList
db := r.db.Model(&WorkItemLink{}).Where... | go | func (r *GormWorkItemLinkRepository) ListChildLinks(ctx context.Context, linkTypeID uuid.UUID, parentIDs ...uuid.UUID) (WorkItemLinkList, error) {
defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "list", "children", "ids"}, time.Now())
var results WorkItemLinkList
db := r.db.Model(&WorkItemLink{}).Where... | [
"func",
"(",
"r",
"*",
"GormWorkItemLinkRepository",
")",
"ListChildLinks",
"(",
"ctx",
"context",
".",
"Context",
",",
"linkTypeID",
"uuid",
".",
"UUID",
",",
"parentIDs",
"...",
"uuid",
".",
"UUID",
")",
"(",
"WorkItemLinkList",
",",
"error",
")",
"{",
"... | // ListChildLinks gets all links to children for the given parents | [
"ListChildLinks",
"gets",
"all",
"links",
"to",
"children",
"for",
"the",
"given",
"parents"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/link_repository.go#L410-L423 |
135,549 | fabric8-services/fabric8-wit | workitem/link/link_repository.go | WorkItemHasChildren | func (r *GormWorkItemLinkRepository) WorkItemHasChildren(ctx context.Context, parentID uuid.UUID) (bool, error) {
defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "has", "children"}, time.Now())
query := fmt.Sprintf(`
SELECT EXISTS (
SELECT 1 FROM %[1]s WHERE id in (
SELECT target_id FROM %[2]s
... | go | func (r *GormWorkItemLinkRepository) WorkItemHasChildren(ctx context.Context, parentID uuid.UUID) (bool, error) {
defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "has", "children"}, time.Now())
query := fmt.Sprintf(`
SELECT EXISTS (
SELECT 1 FROM %[1]s WHERE id in (
SELECT target_id FROM %[2]s
... | [
"func",
"(",
"r",
"*",
"GormWorkItemLinkRepository",
")",
"WorkItemHasChildren",
"(",
"ctx",
"context",
".",
"Context",
",",
"parentID",
"uuid",
".",
"UUID",
")",
"(",
"bool",
",",
"error",
")",
"{",
"defer",
"goa",
".",
"MeasureSince",
"(",
"[",
"]",
"s... | // WorkItemHasChildren returns true if the given parent work item has children;
// otherwise false is returned | [
"WorkItemHasChildren",
"returns",
"true",
"if",
"the",
"given",
"parent",
"work",
"item",
"has",
"children",
";",
"otherwise",
"false",
"is",
"returned"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/workitem/link/link_repository.go#L519-L542 |
135,550 | fabric8-services/fabric8-wit | configuration/configuration.go | String | func (c *Registry) String() string {
allSettings := c.v.AllSettings()
y, err := yaml.Marshal(&allSettings)
if err != nil {
log.WithFields(map[string]interface{}{
"settings": allSettings,
"err": err,
}).Panicln("Failed to marshall config to string")
}
return fmt.Sprintf("%s\n", y)
} | go | func (c *Registry) String() string {
allSettings := c.v.AllSettings()
y, err := yaml.Marshal(&allSettings)
if err != nil {
log.WithFields(map[string]interface{}{
"settings": allSettings,
"err": err,
}).Panicln("Failed to marshall config to string")
}
return fmt.Sprintf("%s\n", y)
} | [
"func",
"(",
"c",
"*",
"Registry",
")",
"String",
"(",
")",
"string",
"{",
"allSettings",
":=",
"c",
".",
"v",
".",
"AllSettings",
"(",
")",
"\n",
"y",
",",
"err",
":=",
"yaml",
".",
"Marshal",
"(",
"&",
"allSettings",
")",
"\n",
"if",
"err",
"!=... | // String returns the current configuration as a string | [
"String",
"returns",
"the",
"current",
"configuration",
"as",
"a",
"string"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/configuration/configuration.go#L20-L30 |
135,551 | fabric8-services/fabric8-wit | configuration/configuration.go | New | func New(configFilePath string) (*Registry, error) {
c := Registry{
v: viper.New(),
}
c.v.SetEnvPrefix("F8")
c.v.AutomaticEnv()
c.v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
c.v.SetTypeByDefaultValue(true)
c.setConfigDefaults()
if configFilePath != "" {
c.v.SetConfigType("yaml")
c.v.SetConfigFile(... | go | func New(configFilePath string) (*Registry, error) {
c := Registry{
v: viper.New(),
}
c.v.SetEnvPrefix("F8")
c.v.AutomaticEnv()
c.v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
c.v.SetTypeByDefaultValue(true)
c.setConfigDefaults()
if configFilePath != "" {
c.v.SetConfigType("yaml")
c.v.SetConfigFile(... | [
"func",
"New",
"(",
"configFilePath",
"string",
")",
"(",
"*",
"Registry",
",",
"error",
")",
"{",
"c",
":=",
"Registry",
"{",
"v",
":",
"viper",
".",
"New",
"(",
")",
",",
"}",
"\n",
"c",
".",
"v",
".",
"SetEnvPrefix",
"(",
"\"",
"\"",
")",
"\... | // New creates a configuration reader object using a configurable configuration
// file path. | [
"New",
"creates",
"a",
"configuration",
"reader",
"object",
"using",
"a",
"configurable",
"configuration",
"file",
"path",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/configuration/configuration.go#L127-L146 |
135,552 | fabric8-services/fabric8-wit | configuration/configuration.go | GetEnvironment | func (c *Registry) GetEnvironment() string {
if c.v.IsSet(varEnvironment) {
return c.v.GetString(varEnvironment)
}
// TODO (@surajssd): remove this part of code once above environment
// variable is set in all configuration, following workaround ain't
// needed after that
authURL := c.GetAuthServiceURL()
if s... | go | func (c *Registry) GetEnvironment() string {
if c.v.IsSet(varEnvironment) {
return c.v.GetString(varEnvironment)
}
// TODO (@surajssd): remove this part of code once above environment
// variable is set in all configuration, following workaround ain't
// needed after that
authURL := c.GetAuthServiceURL()
if s... | [
"func",
"(",
"c",
"*",
"Registry",
")",
"GetEnvironment",
"(",
")",
"string",
"{",
"if",
"c",
".",
"v",
".",
"IsSet",
"(",
"varEnvironment",
")",
"{",
"return",
"c",
".",
"v",
".",
"GetString",
"(",
"varEnvironment",
")",
"\n",
"}",
"\n\n",
"// TODO ... | // GetEnvironment returns the current environment application is deployed in
// like 'prod', 'preview', 'local', etc as the value of environment variable
// `F8_ENVIRONMENT` is set. | [
"GetEnvironment",
"returns",
"the",
"current",
"environment",
"application",
"is",
"deployed",
"in",
"like",
"prod",
"preview",
"local",
"etc",
"as",
"the",
"value",
"of",
"environment",
"variable",
"F8_ENVIRONMENT",
"is",
"set",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/configuration/configuration.go#L377-L392 |
135,553 | fabric8-services/fabric8-wit | configuration/configuration.go | GetKeysEndpoint | func (c *Registry) GetKeysEndpoint() string {
return fmt.Sprintf("%s/api/token/keys", c.v.GetString(varAuthURL))
} | go | func (c *Registry) GetKeysEndpoint() string {
return fmt.Sprintf("%s/api/token/keys", c.v.GetString(varAuthURL))
} | [
"func",
"(",
"c",
"*",
"Registry",
")",
"GetKeysEndpoint",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"c",
".",
"v",
".",
"GetString",
"(",
"varAuthURL",
")",
")",
"\n",
"}"
] | // GetKeysEndpoint returns the endpoint to the auth service for key mgmt. | [
"GetKeysEndpoint",
"returns",
"the",
"endpoint",
"to",
"the",
"auth",
"service",
"for",
"key",
"mgmt",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/configuration/configuration.go#L568-L570 |
135,554 | fabric8-services/fabric8-wit | configuration/configuration.go | GetKeycloakRealm | func (c *Registry) GetKeycloakRealm() string {
if c.v.IsSet(varKeycloakRealm) {
return c.v.GetString(varKeycloakRealm)
}
if c.IsPostgresDeveloperModeEnabled() {
return devModeKeycloakRealm
}
return defaultKeycloakRealm
} | go | func (c *Registry) GetKeycloakRealm() string {
if c.v.IsSet(varKeycloakRealm) {
return c.v.GetString(varKeycloakRealm)
}
if c.IsPostgresDeveloperModeEnabled() {
return devModeKeycloakRealm
}
return defaultKeycloakRealm
} | [
"func",
"(",
"c",
"*",
"Registry",
")",
"GetKeycloakRealm",
"(",
")",
"string",
"{",
"if",
"c",
".",
"v",
".",
"IsSet",
"(",
"varKeycloakRealm",
")",
"{",
"return",
"c",
".",
"v",
".",
"GetString",
"(",
"varKeycloakRealm",
")",
"\n",
"}",
"\n",
"if",... | // GetKeycloakRealm returns the keycloak realm name | [
"GetKeycloakRealm",
"returns",
"the",
"keycloak",
"realm",
"name"
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/configuration/configuration.go#L655-L663 |
135,555 | fabric8-services/fabric8-wit | configuration/configuration.go | GetDeploymentsHTTPTimeoutSeconds | func (c *Registry) GetDeploymentsHTTPTimeoutSeconds() time.Duration {
timeout := c.v.GetInt(varDeploymentsHTTPTimeout)
if timeout < minimumDeploymentsHTTPTimeout {
timeout = minimumDeploymentsHTTPTimeout
}
return time.Duration(timeout) * time.Second
} | go | func (c *Registry) GetDeploymentsHTTPTimeoutSeconds() time.Duration {
timeout := c.v.GetInt(varDeploymentsHTTPTimeout)
if timeout < minimumDeploymentsHTTPTimeout {
timeout = minimumDeploymentsHTTPTimeout
}
return time.Duration(timeout) * time.Second
} | [
"func",
"(",
"c",
"*",
"Registry",
")",
"GetDeploymentsHTTPTimeoutSeconds",
"(",
")",
"time",
".",
"Duration",
"{",
"timeout",
":=",
"c",
".",
"v",
".",
"GetInt",
"(",
"varDeploymentsHTTPTimeout",
")",
"\n",
"if",
"timeout",
"<",
"minimumDeploymentsHTTPTimeout",... | // GetDeploymentsTimeout returns the amount of seconds until it should timeout. | [
"GetDeploymentsTimeout",
"returns",
"the",
"amount",
"of",
"seconds",
"until",
"it",
"should",
"timeout",
"."
] | 54759c80c42ff2cf29b352e0f6c9330ce4ad7fce | https://github.com/fabric8-services/fabric8-wit/blob/54759c80c42ff2cf29b352e0f6c9330ce4ad7fce/configuration/configuration.go#L885-L891 |
135,556 | go-openapi/errors | headers.go | ValidateName | func (e *Validation) ValidateName(name string) *Validation {
if e.Name == "" && name != "" {
e.Name = name
e.message = name + e.message
}
return e
} | go | func (e *Validation) ValidateName(name string) *Validation {
if e.Name == "" && name != "" {
e.Name = name
e.message = name + e.message
}
return e
} | [
"func",
"(",
"e",
"*",
"Validation",
")",
"ValidateName",
"(",
"name",
"string",
")",
"*",
"Validation",
"{",
"if",
"e",
".",
"Name",
"==",
"\"",
"\"",
"&&",
"name",
"!=",
"\"",
"\"",
"{",
"e",
".",
"Name",
"=",
"name",
"\n",
"e",
".",
"message",... | // ValidateName produces an error message name for an aliased property | [
"ValidateName",
"produces",
"an",
"error",
"message",
"name",
"for",
"an",
"aliased",
"property"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/headers.go#L42-L48 |
135,557 | go-openapi/errors | headers.go | InvalidContentType | func InvalidContentType(value string, allowed []string) *Validation {
values := make([]interface{}, 0, len(allowed))
for _, v := range allowed {
values = append(values, v)
}
return &Validation{
code: http.StatusUnsupportedMediaType,
Name: "Content-Type",
In: "header",
Value: value,
Values: ... | go | func InvalidContentType(value string, allowed []string) *Validation {
values := make([]interface{}, 0, len(allowed))
for _, v := range allowed {
values = append(values, v)
}
return &Validation{
code: http.StatusUnsupportedMediaType,
Name: "Content-Type",
In: "header",
Value: value,
Values: ... | [
"func",
"InvalidContentType",
"(",
"value",
"string",
",",
"allowed",
"[",
"]",
"string",
")",
"*",
"Validation",
"{",
"values",
":=",
"make",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"0",
",",
"len",
"(",
"allowed",
")",
")",
"\n",
"for",
"_",
"... | // InvalidContentType error for an invalid content type | [
"InvalidContentType",
"error",
"for",
"an",
"invalid",
"content",
"type"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/headers.go#L56-L69 |
135,558 | go-openapi/errors | headers.go | InvalidResponseFormat | func InvalidResponseFormat(value string, allowed []string) *Validation {
values := make([]interface{}, 0, len(allowed))
for _, v := range allowed {
values = append(values, v)
}
return &Validation{
code: http.StatusNotAcceptable,
Name: "Accept",
In: "header",
Value: value,
Values: values,
... | go | func InvalidResponseFormat(value string, allowed []string) *Validation {
values := make([]interface{}, 0, len(allowed))
for _, v := range allowed {
values = append(values, v)
}
return &Validation{
code: http.StatusNotAcceptable,
Name: "Accept",
In: "header",
Value: value,
Values: values,
... | [
"func",
"InvalidResponseFormat",
"(",
"value",
"string",
",",
"allowed",
"[",
"]",
"string",
")",
"*",
"Validation",
"{",
"values",
":=",
"make",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"0",
",",
"len",
"(",
"allowed",
")",
")",
"\n",
"for",
"_",
... | // InvalidResponseFormat error for an unacceptable response format request | [
"InvalidResponseFormat",
"error",
"for",
"an",
"unacceptable",
"response",
"format",
"request"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/headers.go#L72-L85 |
135,559 | go-openapi/errors | api.go | New | func New(code int32, message string, args ...interface{}) Error {
if len(args) > 0 {
return &apiError{code, fmt.Sprintf(message, args...)}
}
return &apiError{code, message}
} | go | func New(code int32, message string, args ...interface{}) Error {
if len(args) > 0 {
return &apiError{code, fmt.Sprintf(message, args...)}
}
return &apiError{code, message}
} | [
"func",
"New",
"(",
"code",
"int32",
",",
"message",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"Error",
"{",
"if",
"len",
"(",
"args",
")",
">",
"0",
"{",
"return",
"&",
"apiError",
"{",
"code",
",",
"fmt",
".",
"Sprintf",
"(",
"m... | // New creates a new API error with a code and a message | [
"New",
"creates",
"a",
"new",
"API",
"error",
"with",
"a",
"code",
"and",
"a",
"message"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/api.go#L48-L53 |
135,560 | go-openapi/errors | api.go | NotFound | func NotFound(message string, args ...interface{}) Error {
if message == "" {
message = "Not found"
}
return New(http.StatusNotFound, fmt.Sprintf(message, args...))
} | go | func NotFound(message string, args ...interface{}) Error {
if message == "" {
message = "Not found"
}
return New(http.StatusNotFound, fmt.Sprintf(message, args...))
} | [
"func",
"NotFound",
"(",
"message",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"Error",
"{",
"if",
"message",
"==",
"\"",
"\"",
"{",
"message",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"New",
"(",
"http",
".",
"StatusNotFound",
",",... | // NotFound creates a new not found error | [
"NotFound",
"creates",
"a",
"new",
"not",
"found",
"error"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/api.go#L56-L61 |
135,561 | go-openapi/errors | api.go | MethodNotAllowed | func MethodNotAllowed(requested string, allow []string) Error {
msg := fmt.Sprintf("method %s is not allowed, but [%s] are", requested, strings.Join(allow, ","))
return &MethodNotAllowedError{code: http.StatusMethodNotAllowed, Allowed: allow, message: msg}
} | go | func MethodNotAllowed(requested string, allow []string) Error {
msg := fmt.Sprintf("method %s is not allowed, but [%s] are", requested, strings.Join(allow, ","))
return &MethodNotAllowedError{code: http.StatusMethodNotAllowed, Allowed: allow, message: msg}
} | [
"func",
"MethodNotAllowed",
"(",
"requested",
"string",
",",
"allow",
"[",
"]",
"string",
")",
"Error",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"requested",
",",
"strings",
".",
"Join",
"(",
"allow",
",",
"\"",
"\"",
")",
")",
... | // MethodNotAllowed creates a new method not allowed error | [
"MethodNotAllowed",
"creates",
"a",
"new",
"method",
"not",
"allowed",
"error"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/api.go#L113-L116 |
135,562 | go-openapi/errors | api.go | ServeError | func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
rw.Header().Set("Content-Type", "application/json")
switch e := err.(type) {
case *CompositeError:
er := flattenComposite(e)
// strips composite errors to first element only
if len(er.Errors) > 0 {
ServeError(rw, r, er.Errors[0])
} else... | go | func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
rw.Header().Set("Content-Type", "application/json")
switch e := err.(type) {
case *CompositeError:
er := flattenComposite(e)
// strips composite errors to first element only
if len(er.Errors) > 0 {
ServeError(rw, r, er.Errors[0])
} else... | [
"func",
"ServeError",
"(",
"rw",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"err",
"error",
")",
"{",
"rw",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"switch",
"e",
":=",
"... | // ServeError the error handler interface implementation | [
"ServeError",
"the",
"error",
"handler",
"interface",
"implementation"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/api.go#L119-L157 |
135,563 | go-openapi/errors | schema.go | CompositeValidationError | func CompositeValidationError(errors ...error) *CompositeError {
return &CompositeError{
code: CompositeErrorCode,
Errors: append([]error{}, errors...),
message: "validation failure list",
}
} | go | func CompositeValidationError(errors ...error) *CompositeError {
return &CompositeError{
code: CompositeErrorCode,
Errors: append([]error{}, errors...),
message: "validation failure list",
}
} | [
"func",
"CompositeValidationError",
"(",
"errors",
"...",
"error",
")",
"*",
"CompositeError",
"{",
"return",
"&",
"CompositeError",
"{",
"code",
":",
"CompositeErrorCode",
",",
"Errors",
":",
"append",
"(",
"[",
"]",
"error",
"{",
"}",
",",
"errors",
"...",... | // CompositeValidationError an error to wrap a bunch of other errors | [
"CompositeValidationError",
"an",
"error",
"to",
"wrap",
"a",
"bunch",
"of",
"other",
"errors"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L120-L126 |
135,564 | go-openapi/errors | schema.go | FailedAllPatternProperties | func FailedAllPatternProperties(name, in, key string) *Validation {
msg := fmt.Sprintf(failedAllPatternProps, name, key, in)
if in == "" {
msg = fmt.Sprintf(failedAllPatternPropsNoIn, name, key)
}
return &Validation{
code: FailedAllPatternPropsCode,
Name: name,
In: in,
Value: key,
message: ... | go | func FailedAllPatternProperties(name, in, key string) *Validation {
msg := fmt.Sprintf(failedAllPatternProps, name, key, in)
if in == "" {
msg = fmt.Sprintf(failedAllPatternPropsNoIn, name, key)
}
return &Validation{
code: FailedAllPatternPropsCode,
Name: name,
In: in,
Value: key,
message: ... | [
"func",
"FailedAllPatternProperties",
"(",
"name",
",",
"in",
",",
"key",
"string",
")",
"*",
"Validation",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"failedAllPatternProps",
",",
"name",
",",
"key",
",",
"in",
")",
"\n",
"if",
"in",
"==",
"\"",
"\... | // FailedAllPatternProperties an error for when the property doesn't match a pattern | [
"FailedAllPatternProperties",
"an",
"error",
"for",
"when",
"the",
"property",
"doesn",
"t",
"match",
"a",
"pattern"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L129-L141 |
135,565 | go-openapi/errors | schema.go | PropertyNotAllowed | func PropertyNotAllowed(name, in, key string) *Validation {
msg := fmt.Sprintf(unallowedProperty, name, key, in)
if in == "" {
msg = fmt.Sprintf(unallowedPropertyNoIn, name, key)
}
return &Validation{
code: UnallowedPropertyCode,
Name: name,
In: in,
Value: key,
message: msg,
}
} | go | func PropertyNotAllowed(name, in, key string) *Validation {
msg := fmt.Sprintf(unallowedProperty, name, key, in)
if in == "" {
msg = fmt.Sprintf(unallowedPropertyNoIn, name, key)
}
return &Validation{
code: UnallowedPropertyCode,
Name: name,
In: in,
Value: key,
message: msg,
}
} | [
"func",
"PropertyNotAllowed",
"(",
"name",
",",
"in",
",",
"key",
"string",
")",
"*",
"Validation",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"unallowedProperty",
",",
"name",
",",
"key",
",",
"in",
")",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
... | // PropertyNotAllowed an error for when the property doesn't match a pattern | [
"PropertyNotAllowed",
"an",
"error",
"for",
"when",
"the",
"property",
"doesn",
"t",
"match",
"a",
"pattern"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L144-L156 |
135,566 | go-openapi/errors | schema.go | TooFewProperties | func TooFewProperties(name, in string, n int64) *Validation {
msg := fmt.Sprintf(tooFewProperties, name, in, n)
if in == "" {
msg = fmt.Sprintf(tooFewPropertiesNoIn, name, n)
}
return &Validation{
code: TooFewPropertiesCode,
Name: name,
In: in,
Value: n,
message: msg,
}
} | go | func TooFewProperties(name, in string, n int64) *Validation {
msg := fmt.Sprintf(tooFewProperties, name, in, n)
if in == "" {
msg = fmt.Sprintf(tooFewPropertiesNoIn, name, n)
}
return &Validation{
code: TooFewPropertiesCode,
Name: name,
In: in,
Value: n,
message: msg,
}
} | [
"func",
"TooFewProperties",
"(",
"name",
",",
"in",
"string",
",",
"n",
"int64",
")",
"*",
"Validation",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"tooFewProperties",
",",
"name",
",",
"in",
",",
"n",
")",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{... | // TooFewProperties an error for an object with too few properties | [
"TooFewProperties",
"an",
"error",
"for",
"an",
"object",
"with",
"too",
"few",
"properties"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L159-L171 |
135,567 | go-openapi/errors | schema.go | TooManyProperties | func TooManyProperties(name, in string, n int64) *Validation {
msg := fmt.Sprintf(tooManyProperties, name, in, n)
if in == "" {
msg = fmt.Sprintf(tooManyPropertiesNoIn, name, n)
}
return &Validation{
code: TooManyPropertiesCode,
Name: name,
In: in,
Value: n,
message: msg,
}
} | go | func TooManyProperties(name, in string, n int64) *Validation {
msg := fmt.Sprintf(tooManyProperties, name, in, n)
if in == "" {
msg = fmt.Sprintf(tooManyPropertiesNoIn, name, n)
}
return &Validation{
code: TooManyPropertiesCode,
Name: name,
In: in,
Value: n,
message: msg,
}
} | [
"func",
"TooManyProperties",
"(",
"name",
",",
"in",
"string",
",",
"n",
"int64",
")",
"*",
"Validation",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"tooManyProperties",
",",
"name",
",",
"in",
",",
"n",
")",
"\n",
"if",
"in",
"==",
"\"",
"\"",
... | // TooManyProperties an error for an object with too many properties | [
"TooManyProperties",
"an",
"error",
"for",
"an",
"object",
"with",
"too",
"many",
"properties"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L174-L186 |
135,568 | go-openapi/errors | schema.go | AdditionalItemsNotAllowed | func AdditionalItemsNotAllowed(name, in string) *Validation {
msg := fmt.Sprintf(noAdditionalItems, name, in)
if in == "" {
msg = fmt.Sprintf(noAdditionalItemsNoIn, name)
}
return &Validation{
code: NoAdditionalItemsCode,
Name: name,
In: in,
message: msg,
}
} | go | func AdditionalItemsNotAllowed(name, in string) *Validation {
msg := fmt.Sprintf(noAdditionalItems, name, in)
if in == "" {
msg = fmt.Sprintf(noAdditionalItemsNoIn, name)
}
return &Validation{
code: NoAdditionalItemsCode,
Name: name,
In: in,
message: msg,
}
} | [
"func",
"AdditionalItemsNotAllowed",
"(",
"name",
",",
"in",
"string",
")",
"*",
"Validation",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"noAdditionalItems",
",",
"name",
",",
"in",
")",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"msg",
"=",
"fmt",
... | // AdditionalItemsNotAllowed an error for invalid additional items | [
"AdditionalItemsNotAllowed",
"an",
"error",
"for",
"invalid",
"additional",
"items"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L189-L200 |
135,569 | go-openapi/errors | schema.go | InvalidCollectionFormat | func InvalidCollectionFormat(name, in, format string) *Validation {
return &Validation{
code: InvalidTypeCode,
Name: name,
In: in,
Value: format,
message: fmt.Sprintf("the collection format %q is not supported for the %s param %q", format, in, name),
}
} | go | func InvalidCollectionFormat(name, in, format string) *Validation {
return &Validation{
code: InvalidTypeCode,
Name: name,
In: in,
Value: format,
message: fmt.Sprintf("the collection format %q is not supported for the %s param %q", format, in, name),
}
} | [
"func",
"InvalidCollectionFormat",
"(",
"name",
",",
"in",
",",
"format",
"string",
")",
"*",
"Validation",
"{",
"return",
"&",
"Validation",
"{",
"code",
":",
"InvalidTypeCode",
",",
"Name",
":",
"name",
",",
"In",
":",
"in",
",",
"Value",
":",
"format"... | // InvalidCollectionFormat another flavor of invalid type error | [
"InvalidCollectionFormat",
"another",
"flavor",
"of",
"invalid",
"type",
"error"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L203-L211 |
135,570 | go-openapi/errors | schema.go | InvalidTypeName | func InvalidTypeName(typeName string) *Validation {
return &Validation{
code: InvalidTypeCode,
Value: typeName,
message: fmt.Sprintf(invalidType, typeName),
}
} | go | func InvalidTypeName(typeName string) *Validation {
return &Validation{
code: InvalidTypeCode,
Value: typeName,
message: fmt.Sprintf(invalidType, typeName),
}
} | [
"func",
"InvalidTypeName",
"(",
"typeName",
"string",
")",
"*",
"Validation",
"{",
"return",
"&",
"Validation",
"{",
"code",
":",
"InvalidTypeCode",
",",
"Value",
":",
"typeName",
",",
"message",
":",
"fmt",
".",
"Sprintf",
"(",
"invalidType",
",",
"typeName... | // InvalidTypeName an error for when the type is invalid | [
"InvalidTypeName",
"an",
"error",
"for",
"when",
"the",
"type",
"is",
"invalid"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L214-L220 |
135,571 | go-openapi/errors | schema.go | InvalidType | func InvalidType(name, in, typeName string, value interface{}) *Validation {
var message string
if in != "" {
switch value.(type) {
case string:
message = fmt.Sprintf(typeFailWithData, name, in, typeName, value)
case error:
message = fmt.Sprintf(typeFailWithError, name, in, typeName, value)
default:
... | go | func InvalidType(name, in, typeName string, value interface{}) *Validation {
var message string
if in != "" {
switch value.(type) {
case string:
message = fmt.Sprintf(typeFailWithData, name, in, typeName, value)
case error:
message = fmt.Sprintf(typeFailWithError, name, in, typeName, value)
default:
... | [
"func",
"InvalidType",
"(",
"name",
",",
"in",
",",
"typeName",
"string",
",",
"value",
"interface",
"{",
"}",
")",
"*",
"Validation",
"{",
"var",
"message",
"string",
"\n\n",
"if",
"in",
"!=",
"\"",
"\"",
"{",
"switch",
"value",
".",
"(",
"type",
")... | // InvalidType creates an error for when the type is invalid | [
"InvalidType",
"creates",
"an",
"error",
"for",
"when",
"the",
"type",
"is",
"invalid"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L223-L254 |
135,572 | go-openapi/errors | schema.go | DuplicateItems | func DuplicateItems(name, in string) *Validation {
msg := fmt.Sprintf(uniqueFail, name, in)
if in == "" {
msg = fmt.Sprintf(uniqueFailNoIn, name)
}
return &Validation{
code: UniqueFailCode,
Name: name,
In: in,
message: msg,
}
} | go | func DuplicateItems(name, in string) *Validation {
msg := fmt.Sprintf(uniqueFail, name, in)
if in == "" {
msg = fmt.Sprintf(uniqueFailNoIn, name)
}
return &Validation{
code: UniqueFailCode,
Name: name,
In: in,
message: msg,
}
} | [
"func",
"DuplicateItems",
"(",
"name",
",",
"in",
"string",
")",
"*",
"Validation",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"uniqueFail",
",",
"name",
",",
"in",
")",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"msg",
"=",
"fmt",
".",
"Sprintf",... | // DuplicateItems error for when an array contains duplicates | [
"DuplicateItems",
"error",
"for",
"when",
"an",
"array",
"contains",
"duplicates"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L257-L268 |
135,573 | go-openapi/errors | schema.go | TooManyItems | func TooManyItems(name, in string, max int64) *Validation {
msg := fmt.Sprintf(maxItemsFail, name, in, max)
if in == "" {
msg = fmt.Sprintf(maxItemsFailNoIn, name, max)
}
return &Validation{
code: MaxItemsFailCode,
Name: name,
In: in,
message: msg,
}
} | go | func TooManyItems(name, in string, max int64) *Validation {
msg := fmt.Sprintf(maxItemsFail, name, in, max)
if in == "" {
msg = fmt.Sprintf(maxItemsFailNoIn, name, max)
}
return &Validation{
code: MaxItemsFailCode,
Name: name,
In: in,
message: msg,
}
} | [
"func",
"TooManyItems",
"(",
"name",
",",
"in",
"string",
",",
"max",
"int64",
")",
"*",
"Validation",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"maxItemsFail",
",",
"name",
",",
"in",
",",
"max",
")",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
... | // TooManyItems error for when an array contains too many items | [
"TooManyItems",
"error",
"for",
"when",
"an",
"array",
"contains",
"too",
"many",
"items"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L271-L283 |
135,574 | go-openapi/errors | schema.go | TooFewItems | func TooFewItems(name, in string, min int64) *Validation {
msg := fmt.Sprintf(minItemsFail, name, in, min)
if in == "" {
msg = fmt.Sprintf(minItemsFailNoIn, name, min)
}
return &Validation{
code: MinItemsFailCode,
Name: name,
In: in,
message: msg,
}
} | go | func TooFewItems(name, in string, min int64) *Validation {
msg := fmt.Sprintf(minItemsFail, name, in, min)
if in == "" {
msg = fmt.Sprintf(minItemsFailNoIn, name, min)
}
return &Validation{
code: MinItemsFailCode,
Name: name,
In: in,
message: msg,
}
} | [
"func",
"TooFewItems",
"(",
"name",
",",
"in",
"string",
",",
"min",
"int64",
")",
"*",
"Validation",
"{",
"msg",
":=",
"fmt",
".",
"Sprintf",
"(",
"minItemsFail",
",",
"name",
",",
"in",
",",
"min",
")",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
... | // TooFewItems error for when an array contains too few items | [
"TooFewItems",
"error",
"for",
"when",
"an",
"array",
"contains",
"too",
"few",
"items"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L286-L297 |
135,575 | go-openapi/errors | schema.go | ExceedsMaximumInt | func ExceedsMaximumInt(name, in string, max int64, exclusive bool) *Validation {
var message string
if in == "" {
m := maxIncFailNoIn
if exclusive {
m = maxExcFailNoIn
}
message = fmt.Sprintf(m, name, max)
} else {
m := maxIncFail
if exclusive {
m = maxExcFail
}
message = fmt.Sprintf(m, name, i... | go | func ExceedsMaximumInt(name, in string, max int64, exclusive bool) *Validation {
var message string
if in == "" {
m := maxIncFailNoIn
if exclusive {
m = maxExcFailNoIn
}
message = fmt.Sprintf(m, name, max)
} else {
m := maxIncFail
if exclusive {
m = maxExcFail
}
message = fmt.Sprintf(m, name, i... | [
"func",
"ExceedsMaximumInt",
"(",
"name",
",",
"in",
"string",
",",
"max",
"int64",
",",
"exclusive",
"bool",
")",
"*",
"Validation",
"{",
"var",
"message",
"string",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"m",
":=",
"maxIncFailNoIn",
"\n",
"if",
"ex... | // ExceedsMaximumInt error for when maxinum validation fails | [
"ExceedsMaximumInt",
"error",
"for",
"when",
"maxinum",
"validation",
"fails"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L300-L322 |
135,576 | go-openapi/errors | schema.go | ExceedsMinimumInt | func ExceedsMinimumInt(name, in string, min int64, exclusive bool) *Validation {
var message string
if in == "" {
m := minIncFailNoIn
if exclusive {
m = minExcFailNoIn
}
message = fmt.Sprintf(m, name, min)
} else {
m := minIncFail
if exclusive {
m = minExcFail
}
message = fmt.Sprintf(m, name, i... | go | func ExceedsMinimumInt(name, in string, min int64, exclusive bool) *Validation {
var message string
if in == "" {
m := minIncFailNoIn
if exclusive {
m = minExcFailNoIn
}
message = fmt.Sprintf(m, name, min)
} else {
m := minIncFail
if exclusive {
m = minExcFail
}
message = fmt.Sprintf(m, name, i... | [
"func",
"ExceedsMinimumInt",
"(",
"name",
",",
"in",
"string",
",",
"min",
"int64",
",",
"exclusive",
"bool",
")",
"*",
"Validation",
"{",
"var",
"message",
"string",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"m",
":=",
"minIncFailNoIn",
"\n",
"if",
"ex... | // ExceedsMinimumInt error for when maxinum validation fails | [
"ExceedsMinimumInt",
"error",
"for",
"when",
"maxinum",
"validation",
"fails"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L375-L397 |
135,577 | go-openapi/errors | schema.go | NotMultipleOf | func NotMultipleOf(name, in string, multiple interface{}) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(multipleOfFailNoIn, name, multiple)
} else {
msg = fmt.Sprintf(multipleOfFail, name, in, multiple)
}
return &Validation{
code: MultipleOfFailCode,
Name: name,
In: in,
Value:... | go | func NotMultipleOf(name, in string, multiple interface{}) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(multipleOfFailNoIn, name, multiple)
} else {
msg = fmt.Sprintf(multipleOfFail, name, in, multiple)
}
return &Validation{
code: MultipleOfFailCode,
Name: name,
In: in,
Value:... | [
"func",
"NotMultipleOf",
"(",
"name",
",",
"in",
"string",
",",
"multiple",
"interface",
"{",
"}",
")",
"*",
"Validation",
"{",
"var",
"msg",
"string",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"msg",
"=",
"fmt",
".",
"Sprintf",
"(",
"multipleOfFailNoIn... | // NotMultipleOf error for when multiple of validation fails | [
"NotMultipleOf",
"error",
"for",
"when",
"multiple",
"of",
"validation",
"fails"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L450-L464 |
135,578 | go-openapi/errors | schema.go | EnumFail | func EnumFail(name, in string, value interface{}, values []interface{}) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(enumFailNoIn, name, values)
} else {
msg = fmt.Sprintf(enumFail, name, in, values)
}
return &Validation{
code: EnumFailCode,
Name: name,
In: in,
Value: valu... | go | func EnumFail(name, in string, value interface{}, values []interface{}) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(enumFailNoIn, name, values)
} else {
msg = fmt.Sprintf(enumFail, name, in, values)
}
return &Validation{
code: EnumFailCode,
Name: name,
In: in,
Value: valu... | [
"func",
"EnumFail",
"(",
"name",
",",
"in",
"string",
",",
"value",
"interface",
"{",
"}",
",",
"values",
"[",
"]",
"interface",
"{",
"}",
")",
"*",
"Validation",
"{",
"var",
"msg",
"string",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"msg",
"=",
"... | // EnumFail error for when an enum validation fails | [
"EnumFail",
"error",
"for",
"when",
"an",
"enum",
"validation",
"fails"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L467-L483 |
135,579 | go-openapi/errors | schema.go | Required | func Required(name, in string) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(requiredFailNoIn, name)
} else {
msg = fmt.Sprintf(requiredFail, name, in)
}
return &Validation{
code: RequiredFailCode,
Name: name,
In: in,
message: msg,
}
} | go | func Required(name, in string) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(requiredFailNoIn, name)
} else {
msg = fmt.Sprintf(requiredFail, name, in)
}
return &Validation{
code: RequiredFailCode,
Name: name,
In: in,
message: msg,
}
} | [
"func",
"Required",
"(",
"name",
",",
"in",
"string",
")",
"*",
"Validation",
"{",
"var",
"msg",
"string",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"msg",
"=",
"fmt",
".",
"Sprintf",
"(",
"requiredFailNoIn",
",",
"name",
")",
"\n",
"}",
"else",
"{"... | // Required error for when a value is missing | [
"Required",
"error",
"for",
"when",
"a",
"value",
"is",
"missing"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L486-L499 |
135,580 | go-openapi/errors | schema.go | TooLong | func TooLong(name, in string, max int64) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(tooLongMessageNoIn, name, max)
} else {
msg = fmt.Sprintf(tooLongMessage, name, in, max)
}
return &Validation{
code: TooLongFailCode,
Name: name,
In: in,
message: msg,
}
} | go | func TooLong(name, in string, max int64) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(tooLongMessageNoIn, name, max)
} else {
msg = fmt.Sprintf(tooLongMessage, name, in, max)
}
return &Validation{
code: TooLongFailCode,
Name: name,
In: in,
message: msg,
}
} | [
"func",
"TooLong",
"(",
"name",
",",
"in",
"string",
",",
"max",
"int64",
")",
"*",
"Validation",
"{",
"var",
"msg",
"string",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"msg",
"=",
"fmt",
".",
"Sprintf",
"(",
"tooLongMessageNoIn",
",",
"name",
",",
... | // TooLong error for when a string is too long | [
"TooLong",
"error",
"for",
"when",
"a",
"string",
"is",
"too",
"long"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L502-L515 |
135,581 | go-openapi/errors | schema.go | TooShort | func TooShort(name, in string, min int64) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(tooShortMessageNoIn, name, min)
} else {
msg = fmt.Sprintf(tooShortMessage, name, in, min)
}
return &Validation{
code: TooShortFailCode,
Name: name,
In: in,
message: msg,
}
} | go | func TooShort(name, in string, min int64) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(tooShortMessageNoIn, name, min)
} else {
msg = fmt.Sprintf(tooShortMessage, name, in, min)
}
return &Validation{
code: TooShortFailCode,
Name: name,
In: in,
message: msg,
}
} | [
"func",
"TooShort",
"(",
"name",
",",
"in",
"string",
",",
"min",
"int64",
")",
"*",
"Validation",
"{",
"var",
"msg",
"string",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"msg",
"=",
"fmt",
".",
"Sprintf",
"(",
"tooShortMessageNoIn",
",",
"name",
",",
... | // TooShort error for when a string is too short | [
"TooShort",
"error",
"for",
"when",
"a",
"string",
"is",
"too",
"short"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L518-L532 |
135,582 | go-openapi/errors | schema.go | FailedPattern | func FailedPattern(name, in, pattern string) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(patternFailNoIn, name, pattern)
} else {
msg = fmt.Sprintf(patternFail, name, in, pattern)
}
return &Validation{
code: PatternFailCode,
Name: name,
In: in,
message: msg,
}
} | go | func FailedPattern(name, in, pattern string) *Validation {
var msg string
if in == "" {
msg = fmt.Sprintf(patternFailNoIn, name, pattern)
} else {
msg = fmt.Sprintf(patternFail, name, in, pattern)
}
return &Validation{
code: PatternFailCode,
Name: name,
In: in,
message: msg,
}
} | [
"func",
"FailedPattern",
"(",
"name",
",",
"in",
",",
"pattern",
"string",
")",
"*",
"Validation",
"{",
"var",
"msg",
"string",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"msg",
"=",
"fmt",
".",
"Sprintf",
"(",
"patternFailNoIn",
",",
"name",
",",
"pat... | // FailedPattern error for when a string fails a regex pattern match
// the pattern that is returned is the ECMA syntax version of the pattern not the golang version. | [
"FailedPattern",
"error",
"for",
"when",
"a",
"string",
"fails",
"a",
"regex",
"pattern",
"match",
"the",
"pattern",
"that",
"is",
"returned",
"is",
"the",
"ECMA",
"syntax",
"version",
"of",
"the",
"pattern",
"not",
"the",
"golang",
"version",
"."
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L536-L550 |
135,583 | go-openapi/errors | schema.go | MultipleOfMustBePositive | func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation {
return &Validation{
code: MultipleOfMustBePositiveCode,
Name: name,
In: in,
Value: factor,
message: fmt.Sprintf(multipleOfMustBePositive, name, factor),
}
} | go | func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation {
return &Validation{
code: MultipleOfMustBePositiveCode,
Name: name,
In: in,
Value: factor,
message: fmt.Sprintf(multipleOfMustBePositive, name, factor),
}
} | [
"func",
"MultipleOfMustBePositive",
"(",
"name",
",",
"in",
"string",
",",
"factor",
"interface",
"{",
"}",
")",
"*",
"Validation",
"{",
"return",
"&",
"Validation",
"{",
"code",
":",
"MultipleOfMustBePositiveCode",
",",
"Name",
":",
"name",
",",
"In",
":",
... | // MultipleOfMustBePositive error for when a
// multipleOf factor is negative | [
"MultipleOfMustBePositive",
"error",
"for",
"when",
"a",
"multipleOf",
"factor",
"is",
"negative"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/schema.go#L554-L562 |
135,584 | go-openapi/errors | parsing.go | NewParseError | func NewParseError(name, in, value string, reason error) *ParseError {
var msg string
if in == "" {
msg = fmt.Sprintf(parseErrorTemplContentNoIn, name, value, reason)
} else {
msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason)
}
return &ParseError{
code: 400,
Name: name,
In: in... | go | func NewParseError(name, in, value string, reason error) *ParseError {
var msg string
if in == "" {
msg = fmt.Sprintf(parseErrorTemplContentNoIn, name, value, reason)
} else {
msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason)
}
return &ParseError{
code: 400,
Name: name,
In: in... | [
"func",
"NewParseError",
"(",
"name",
",",
"in",
",",
"value",
"string",
",",
"reason",
"error",
")",
"*",
"ParseError",
"{",
"var",
"msg",
"string",
"\n",
"if",
"in",
"==",
"\"",
"\"",
"{",
"msg",
"=",
"fmt",
".",
"Sprintf",
"(",
"parseErrorTemplConte... | // NewParseError creates a new parse error | [
"NewParseError",
"creates",
"a",
"new",
"parse",
"error"
] | df3fda67a4c851b789d9b34a92cb0edef5734e2c | https://github.com/go-openapi/errors/blob/df3fda67a4c851b789d9b34a92cb0edef5734e2c/parsing.go#L44-L59 |
135,585 | karan/vocabulary | vocabulary.go | Word | func (v Vocabulary) Word(w string) (Word, error) {
if w == "" {
return Word{}, Error("word must be non-empty string")
}
if v.c.BigHugeLabsApiKey == "" {
return Word{}, Error("BigHugeLabsApiKey required.")
}
if v.c.WordnikApiKey == "" {
return Word{}, Error("WordnikApiKey required.")
}
meanin... | go | func (v Vocabulary) Word(w string) (Word, error) {
if w == "" {
return Word{}, Error("word must be non-empty string")
}
if v.c.BigHugeLabsApiKey == "" {
return Word{}, Error("BigHugeLabsApiKey required.")
}
if v.c.WordnikApiKey == "" {
return Word{}, Error("WordnikApiKey required.")
}
meanin... | [
"func",
"(",
"v",
"Vocabulary",
")",
"Word",
"(",
"w",
"string",
")",
"(",
"Word",
",",
"error",
")",
"{",
"if",
"w",
"==",
"\"",
"\"",
"{",
"return",
"Word",
"{",
"}",
",",
"Error",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"v",
".",
... | // Creates a new Word object collecting as much information as possible.
// Requires having all API keys. | [
"Creates",
"a",
"new",
"Word",
"object",
"collecting",
"as",
"much",
"information",
"as",
"possible",
".",
"Requires",
"having",
"all",
"API",
"keys",
"."
] | ca7289b4cdf4d4336053b728c1baf2864188b0b8 | https://github.com/karan/vocabulary/blob/ca7289b4cdf4d4336053b728c1baf2864188b0b8/vocabulary.go#L94-L139 |
135,586 | karan/vocabulary | vocabulary.go | Meanings | func (v Vocabulary) Meanings(w string) ([]string, error) {
contents, err := makeReq(fmt.Sprintf(meaningApiUrl, w))
if err != nil {
return []string{}, err
}
var glosbe Glosbe
err = json.Unmarshal(contents, &glosbe)
if err != nil || glosbe.Result != "ok" || len(glosbe.Tuc) == 0 {
return []string{}, ... | go | func (v Vocabulary) Meanings(w string) ([]string, error) {
contents, err := makeReq(fmt.Sprintf(meaningApiUrl, w))
if err != nil {
return []string{}, err
}
var glosbe Glosbe
err = json.Unmarshal(contents, &glosbe)
if err != nil || glosbe.Result != "ok" || len(glosbe.Tuc) == 0 {
return []string{}, ... | [
"func",
"(",
"v",
"Vocabulary",
")",
"Meanings",
"(",
"w",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"contents",
",",
"err",
":=",
"makeReq",
"(",
"fmt",
".",
"Sprintf",
"(",
"meaningApiUrl",
",",
"w",
")",
")",
"\n",
"if",
... | // Returns a list of strings representing the meanings of the given word. | [
"Returns",
"a",
"list",
"of",
"strings",
"representing",
"the",
"meanings",
"of",
"the",
"given",
"word",
"."
] | ca7289b4cdf4d4336053b728c1baf2864188b0b8 | https://github.com/karan/vocabulary/blob/ca7289b4cdf4d4336053b728c1baf2864188b0b8/vocabulary.go#L142-L167 |
135,587 | karan/vocabulary | vocabulary.go | Synonyms | func (v Vocabulary) Synonyms(w string) ([]string, error) {
contents, err := makeReq(fmt.Sprintf(synonymsApiUrl, w))
if err != nil {
return []string{}, err
}
var glosbe Glosbe
err = json.Unmarshal(contents, &glosbe)
if err != nil || glosbe.Result != "ok" || len(glosbe.Tuc) < 2 {
return []string{}, ... | go | func (v Vocabulary) Synonyms(w string) ([]string, error) {
contents, err := makeReq(fmt.Sprintf(synonymsApiUrl, w))
if err != nil {
return []string{}, err
}
var glosbe Glosbe
err = json.Unmarshal(contents, &glosbe)
if err != nil || glosbe.Result != "ok" || len(glosbe.Tuc) < 2 {
return []string{}, ... | [
"func",
"(",
"v",
"Vocabulary",
")",
"Synonyms",
"(",
"w",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"contents",
",",
"err",
":=",
"makeReq",
"(",
"fmt",
".",
"Sprintf",
"(",
"synonymsApiUrl",
",",
"w",
")",
")",
"\n",
"if",
... | // Returns a list of strings representing the synonyms of the given word. | [
"Returns",
"a",
"list",
"of",
"strings",
"representing",
"the",
"synonyms",
"of",
"the",
"given",
"word",
"."
] | ca7289b4cdf4d4336053b728c1baf2864188b0b8 | https://github.com/karan/vocabulary/blob/ca7289b4cdf4d4336053b728c1baf2864188b0b8/vocabulary.go#L170-L195 |
135,588 | karan/vocabulary | vocabulary.go | Antonyms | func (v Vocabulary) Antonyms(w string) ([]string, error) {
if v.c.BigHugeLabsApiKey == "" {
return []string{}, Error("BigHugeLabsApiKey required.")
}
contents, err := makeReq(fmt.Sprintf(antonymsApiUrl, v.c.BigHugeLabsApiKey, w))
if err != nil {
return []string{}, err
}
if string(contents) == "" {... | go | func (v Vocabulary) Antonyms(w string) ([]string, error) {
if v.c.BigHugeLabsApiKey == "" {
return []string{}, Error("BigHugeLabsApiKey required.")
}
contents, err := makeReq(fmt.Sprintf(antonymsApiUrl, v.c.BigHugeLabsApiKey, w))
if err != nil {
return []string{}, err
}
if string(contents) == "" {... | [
"func",
"(",
"v",
"Vocabulary",
")",
"Antonyms",
"(",
"w",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"if",
"v",
".",
"c",
".",
"BigHugeLabsApiKey",
"==",
"\"",
"\"",
"{",
"return",
"[",
"]",
"string",
"{",
"}",
",",
"Error",... | // Returns a list of strings representing the antonyms of the given word. | [
"Returns",
"a",
"list",
"of",
"strings",
"representing",
"the",
"antonyms",
"of",
"the",
"given",
"word",
"."
] | ca7289b4cdf4d4336053b728c1baf2864188b0b8 | https://github.com/karan/vocabulary/blob/ca7289b4cdf4d4336053b728c1baf2864188b0b8/vocabulary.go#L198-L221 |
135,589 | karan/vocabulary | vocabulary.go | PartOfSpeech | func (v Vocabulary) PartOfSpeech(w string) ([]PartOfSpeech, error) {
if v.c.WordnikApiKey == "" {
return []PartOfSpeech{}, Error("WordnikApiKey required.")
}
contents, err := makeReq(fmt.Sprintf(partOfSpeechApiUrl, w, v.c.WordnikApiKey))
if err != nil {
return []PartOfSpeech{}, err
}
var result []... | go | func (v Vocabulary) PartOfSpeech(w string) ([]PartOfSpeech, error) {
if v.c.WordnikApiKey == "" {
return []PartOfSpeech{}, Error("WordnikApiKey required.")
}
contents, err := makeReq(fmt.Sprintf(partOfSpeechApiUrl, w, v.c.WordnikApiKey))
if err != nil {
return []PartOfSpeech{}, err
}
var result []... | [
"func",
"(",
"v",
"Vocabulary",
")",
"PartOfSpeech",
"(",
"w",
"string",
")",
"(",
"[",
"]",
"PartOfSpeech",
",",
"error",
")",
"{",
"if",
"v",
".",
"c",
".",
"WordnikApiKey",
"==",
"\"",
"\"",
"{",
"return",
"[",
"]",
"PartOfSpeech",
"{",
"}",
","... | // Returns a list of PartOfSpeech structs representing the POS of the given word. | [
"Returns",
"a",
"list",
"of",
"PartOfSpeech",
"structs",
"representing",
"the",
"POS",
"of",
"the",
"given",
"word",
"."
] | ca7289b4cdf4d4336053b728c1baf2864188b0b8 | https://github.com/karan/vocabulary/blob/ca7289b4cdf4d4336053b728c1baf2864188b0b8/vocabulary.go#L224-L240 |
135,590 | karan/vocabulary | vocabulary.go | UsageExample | func (v Vocabulary) UsageExample(w string) ([]string, error) {
contents, err := makeReq(fmt.Sprintf(usageExampleApiUrl, w))
if err != nil {
return []string{}, err
}
var resp UrbanDictResp
err = json.Unmarshal(contents, &resp)
if err != nil {
return []string{}, err
}
if len(resp.Things) == 0 {
... | go | func (v Vocabulary) UsageExample(w string) ([]string, error) {
contents, err := makeReq(fmt.Sprintf(usageExampleApiUrl, w))
if err != nil {
return []string{}, err
}
var resp UrbanDictResp
err = json.Unmarshal(contents, &resp)
if err != nil {
return []string{}, err
}
if len(resp.Things) == 0 {
... | [
"func",
"(",
"v",
"Vocabulary",
")",
"UsageExample",
"(",
"w",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"contents",
",",
"err",
":=",
"makeReq",
"(",
"fmt",
".",
"Sprintf",
"(",
"usageExampleApiUrl",
",",
"w",
")",
")",
"\n",
... | // Returns a list of strings representing usage examples of the given word. | [
"Returns",
"a",
"list",
"of",
"strings",
"representing",
"usage",
"examples",
"of",
"the",
"given",
"word",
"."
] | ca7289b4cdf4d4336053b728c1baf2864188b0b8 | https://github.com/karan/vocabulary/blob/ca7289b4cdf4d4336053b728c1baf2864188b0b8/vocabulary.go#L243-L268 |
135,591 | qlik-oss/enigma-go | session_messages.go | SessionMessageChannel | func (e *sessionMessages) SessionMessageChannel(topics ...string) chan SessionMessage {
e.mutex.Lock()
defer e.mutex.Unlock()
channelEntry := &sessionMessageChannelEntry{topics: topics, channel: make(chan SessionMessage, 16+len(e.history))}
e.channels[channelEntry] = true
for _, oldEvent := range e.history {
cha... | go | func (e *sessionMessages) SessionMessageChannel(topics ...string) chan SessionMessage {
e.mutex.Lock()
defer e.mutex.Unlock()
channelEntry := &sessionMessageChannelEntry{topics: topics, channel: make(chan SessionMessage, 16+len(e.history))}
e.channels[channelEntry] = true
for _, oldEvent := range e.history {
cha... | [
"func",
"(",
"e",
"*",
"sessionMessages",
")",
"SessionMessageChannel",
"(",
"topics",
"...",
"string",
")",
"chan",
"SessionMessage",
"{",
"e",
".",
"mutex",
".",
"Lock",
"(",
")",
"\n",
"defer",
"e",
".",
"mutex",
".",
"Unlock",
"(",
")",
"\n",
"chan... | // SessionMessageChannel returns a channel that receives notifications from Qlik Associative Engine. To only receive
// certain events a list of topics can be supplied. If no topics are supplied all events are received. | [
"SessionMessageChannel",
"returns",
"a",
"channel",
"that",
"receives",
"notifications",
"from",
"Qlik",
"Associative",
"Engine",
".",
"To",
"only",
"receive",
"certain",
"events",
"a",
"list",
"of",
"topics",
"can",
"be",
"supplied",
".",
"If",
"no",
"topics",
... | 7fdea27298e888663c973c15dbbfba2c0a1ec085 | https://github.com/qlik-oss/enigma-go/blob/7fdea27298e888663c973c15dbbfba2c0a1ec085/session_messages.go#L55-L64 |
135,592 | qlik-oss/enigma-go | session_messages.go | CloseSessionMessageChannel | func (e *sessionMessages) CloseSessionMessageChannel(channel chan SessionMessage) {
e.mutex.Lock()
defer e.mutex.Unlock()
for channelEntry := range e.channels {
if channelEntry.channel == channel {
close(channelEntry.channel)
delete(e.channels, channelEntry)
break
}
}
} | go | func (e *sessionMessages) CloseSessionMessageChannel(channel chan SessionMessage) {
e.mutex.Lock()
defer e.mutex.Unlock()
for channelEntry := range e.channels {
if channelEntry.channel == channel {
close(channelEntry.channel)
delete(e.channels, channelEntry)
break
}
}
} | [
"func",
"(",
"e",
"*",
"sessionMessages",
")",
"CloseSessionMessageChannel",
"(",
"channel",
"chan",
"SessionMessage",
")",
"{",
"e",
".",
"mutex",
".",
"Lock",
"(",
")",
"\n",
"defer",
"e",
".",
"mutex",
".",
"Unlock",
"(",
")",
"\n",
"for",
"channelEnt... | // CloseSessionMessageChannel closes and unregisters the supplied event channel from the session. | [
"CloseSessionMessageChannel",
"closes",
"and",
"unregisters",
"the",
"supplied",
"event",
"channel",
"from",
"the",
"session",
"."
] | 7fdea27298e888663c973c15dbbfba2c0a1ec085 | https://github.com/qlik-oss/enigma-go/blob/7fdea27298e888663c973c15dbbfba2c0a1ec085/session_messages.go#L67-L77 |
135,593 | qlik-oss/enigma-go | session_messages.go | SessionState | func (e *sessionMessages) SessionState(ctx context.Context) (string, error) {
channel := e.SessionMessageChannel("OnConnected")
defer e.CloseSessionMessageChannel(channel)
select {
case <-ctx.Done():
return "", ctx.Err()
case message := <-channel:
connectedInfo := &onConnectedEvent{}
err := json.Unmarshal(me... | go | func (e *sessionMessages) SessionState(ctx context.Context) (string, error) {
channel := e.SessionMessageChannel("OnConnected")
defer e.CloseSessionMessageChannel(channel)
select {
case <-ctx.Done():
return "", ctx.Err()
case message := <-channel:
connectedInfo := &onConnectedEvent{}
err := json.Unmarshal(me... | [
"func",
"(",
"e",
"*",
"sessionMessages",
")",
"SessionState",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"string",
",",
"error",
")",
"{",
"channel",
":=",
"e",
".",
"SessionMessageChannel",
"(",
"\"",
"\"",
")",
"\n",
"defer",
"e",
".",
"CloseS... | // SessionState returns either SESSION_CREATED or SESSION_ATTACHED to describe the status of the current websocket session | [
"SessionState",
"returns",
"either",
"SESSION_CREATED",
"or",
"SESSION_ATTACHED",
"to",
"describe",
"the",
"status",
"of",
"the",
"current",
"websocket",
"session"
] | 7fdea27298e888663c973c15dbbfba2c0a1ec085 | https://github.com/qlik-oss/enigma-go/blob/7fdea27298e888663c973c15dbbfba2c0a1ec085/session_messages.go#L93-L107 |
135,594 | qlik-oss/enigma-go | qix_generated.go | ClearUndoBuffer | func (obj *Doc) ClearUndoBuffer(ctx context.Context) error {
err := obj.rpc(ctx, "ClearUndoBuffer", nil)
return err
} | go | func (obj *Doc) ClearUndoBuffer(ctx context.Context) error {
err := obj.rpc(ctx, "ClearUndoBuffer", nil)
return err
} | [
"func",
"(",
"obj",
"*",
"Doc",
")",
"ClearUndoBuffer",
"(",
"ctx",
"context",
".",
"Context",
")",
"error",
"{",
"err",
":=",
"obj",
".",
"rpc",
"(",
"ctx",
",",
"\"",
"\"",
",",
"nil",
")",
"\n",
"return",
"err",
"\n",
"}"
] | // Clears entirely the undo and redo buffer. | [
"Clears",
"entirely",
"the",
"undo",
"and",
"redo",
"buffer",
"."
] | 7fdea27298e888663c973c15dbbfba2c0a1ec085 | https://github.com/qlik-oss/enigma-go/blob/7fdea27298e888663c973c15dbbfba2c0a1ec085/qix_generated.go#L4715-L4718 |
135,595 | qlik-oss/enigma-go | qix_generated.go | ForwardCount | func (obj *Doc) ForwardCount(ctx context.Context) (int, error) {
result := &struct {
Return int `json:"qReturn"`
} {}
err := obj.rpc(ctx, "ForwardCount", result)
return result.Return, err
} | go | func (obj *Doc) ForwardCount(ctx context.Context) (int, error) {
result := &struct {
Return int `json:"qReturn"`
} {}
err := obj.rpc(ctx, "ForwardCount", result)
return result.Return, err
} | [
"func",
"(",
"obj",
"*",
"Doc",
")",
"ForwardCount",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"int",
",",
"error",
")",
"{",
"result",
":=",
"&",
"struct",
"{",
"Return",
"int",
"`json:\"qReturn\"`",
"\n",
"}",
"{",
"}",
"\n",
"err",
":=",
... | // Returns the number of entries on the Forward stack. | [
"Returns",
"the",
"number",
"of",
"entries",
"on",
"the",
"Forward",
"stack",
"."
] | 7fdea27298e888663c973c15dbbfba2c0a1ec085 | https://github.com/qlik-oss/enigma-go/blob/7fdea27298e888663c973c15dbbfba2c0a1ec085/qix_generated.go#L5747-L5753 |
135,596 | qlik-oss/enigma-go | qix_generated.go | GetFavoriteVariables | func (obj *Doc) GetFavoriteVariables(ctx context.Context) ([]string, error) {
result := &struct {
Names []string `json:"qNames"`
} {}
err := obj.rpc(ctx, "GetFavoriteVariables", result)
return result.Names, err
} | go | func (obj *Doc) GetFavoriteVariables(ctx context.Context) ([]string, error) {
result := &struct {
Names []string `json:"qNames"`
} {}
err := obj.rpc(ctx, "GetFavoriteVariables", result)
return result.Names, err
} | [
"func",
"(",
"obj",
"*",
"Doc",
")",
"GetFavoriteVariables",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"result",
":=",
"&",
"struct",
"{",
"Names",
"[",
"]",
"string",
"`json:\"qNames\"`",
"\n",
"}",
... | // Retrieves the variables that are tagged as favorite. | [
"Retrieves",
"the",
"variables",
"that",
"are",
"tagged",
"as",
"favorite",
"."
] | 7fdea27298e888663c973c15dbbfba2c0a1ec085 | https://github.com/qlik-oss/enigma-go/blob/7fdea27298e888663c973c15dbbfba2c0a1ec085/qix_generated.go#L6258-L6264 |
135,597 | qlik-oss/enigma-go | qix_generated.go | GetLocaleInfo | func (obj *Doc) GetLocaleInfo(ctx context.Context) (*LocaleInfo, error) {
result := &struct {
Return *LocaleInfo `json:"qReturn"`
} {}
err := obj.rpc(ctx, "GetLocaleInfo", result)
return result.Return, err
} | go | func (obj *Doc) GetLocaleInfo(ctx context.Context) (*LocaleInfo, error) {
result := &struct {
Return *LocaleInfo `json:"qReturn"`
} {}
err := obj.rpc(ctx, "GetLocaleInfo", result)
return result.Return, err
} | [
"func",
"(",
"obj",
"*",
"Doc",
")",
"GetLocaleInfo",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"*",
"LocaleInfo",
",",
"error",
")",
"{",
"result",
":=",
"&",
"struct",
"{",
"Return",
"*",
"LocaleInfo",
"`json:\"qReturn\"`",
"\n",
"}",
"{",
"}"... | // Returns locale information. | [
"Returns",
"locale",
"information",
"."
] | 7fdea27298e888663c973c15dbbfba2c0a1ec085 | https://github.com/qlik-oss/enigma-go/blob/7fdea27298e888663c973c15dbbfba2c0a1ec085/qix_generated.go#L6806-L6812 |
135,598 | qlik-oss/enigma-go | qix_generated.go | GetScript | func (obj *Doc) GetScript(ctx context.Context) (string, error) {
result := &struct {
Script string `json:"qScript"`
} {}
err := obj.rpc(ctx, "GetScript", result)
return result.Script, err
} | go | func (obj *Doc) GetScript(ctx context.Context) (string, error) {
result := &struct {
Script string `json:"qScript"`
} {}
err := obj.rpc(ctx, "GetScript", result)
return result.Script, err
} | [
"func",
"(",
"obj",
"*",
"Doc",
")",
"GetScript",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"string",
",",
"error",
")",
"{",
"result",
":=",
"&",
"struct",
"{",
"Script",
"string",
"`json:\"qScript\"`",
"\n",
"}",
"{",
"}",
"\n",
"err",
":=",... | // Gets values in script. | [
"Gets",
"values",
"in",
"script",
"."
] | 7fdea27298e888663c973c15dbbfba2c0a1ec085 | https://github.com/qlik-oss/enigma-go/blob/7fdea27298e888663c973c15dbbfba2c0a1ec085/qix_generated.go#L6977-L6983 |
135,599 | qlik-oss/enigma-go | qix_generated.go | Redo | func (obj *Doc) Redo(ctx context.Context) (bool, error) {
result := &struct {
Success bool `json:"qSuccess"`
} {}
err := obj.rpc(ctx, "Redo", result)
return result.Success, err
} | go | func (obj *Doc) Redo(ctx context.Context) (bool, error) {
result := &struct {
Success bool `json:"qSuccess"`
} {}
err := obj.rpc(ctx, "Redo", result)
return result.Success, err
} | [
"func",
"(",
"obj",
"*",
"Doc",
")",
"Redo",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"bool",
",",
"error",
")",
"{",
"result",
":=",
"&",
"struct",
"{",
"Success",
"bool",
"`json:\"qSuccess\"`",
"\n",
"}",
"{",
"}",
"\n",
"err",
":=",
"obj... | // Redoes the previous operation.
//
// The operation is successful if qSuccess is set to true. | [
"Redoes",
"the",
"previous",
"operation",
".",
"The",
"operation",
"is",
"successful",
"if",
"qSuccess",
"is",
"set",
"to",
"true",
"."
] | 7fdea27298e888663c973c15dbbfba2c0a1ec085 | https://github.com/qlik-oss/enigma-go/blob/7fdea27298e888663c973c15dbbfba2c0a1ec085/qix_generated.go#L7470-L7476 |
Subsets and Splits
SQL Console for google/code_x_glue_ct_code_to_text
This query implements a thoughtful three-tier curation strategy to build a balanced safety dataset, categorizing code by destructive operations, safe I/O operations, and pure computational negatives with subsampling—revealing important patterns about how destructive intent manifests in Python code for model safety research.
SQL Console for google/code_x_glue_ct_code_to_text
This query performs meaningful classification of Python code samples into safety-relevant tiers based on destructive operations, I/O patterns, and pure computation, which could be valuable for building safety classifiers or curating training data, though the output itself is a filtered/ranked dataset rather than revealing novel statistical insights.