query
stringlengths
7
3.85k
document
stringlengths
11
430k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns the value of the 'go_package' option of the first .proto file found in the same directory as projectFile
func detectGoPackageForProject(projectFile string) (string, error) { var goPkg string projectDir := filepath.Dir(projectFile) if err := filepath.Walk(projectDir, func(protoFile string, info os.FileInfo, err error) error { // already set if goPkg != "" { return nil } if !strings.HasSuffix(protoFile, ".proto") { return nil } // search for go_package on protos in the same dir as the project.json if projectDir != filepath.Dir(protoFile) { return nil } content, err := ioutil.ReadFile(protoFile) if err != nil { return err } lines := strings.Split(string(content), "\n") for _, line := range lines { goPackage := goPackageStatementRegex.FindStringSubmatch(line) if len(goPackage) == 0 { continue } if len(goPackage) != 2 { return errors.Errorf("parsing go_package error: from %v found %v", line, goPackage) } goPkg = goPackage[1] break } return nil }); err != nil { return "", err } if goPkg == "" { return "", errors.Errorf("no go_package statement found in root dir of project %v", projectFile) } return goPkg, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (g *Generator) GoFilePackage(depfile *fdep.DepFile) string {\n\treturn fproto_wrap.BaseName(g.GoWrapPackage(depfile))\n}", "func (g *Generator) GoPackage(depfile *fdep.DepFile) string {\n\tfor _, o := range depfile.ProtoFile.Options {\n\t\tif o.Name == \"go_package\" {\n\t\t\treturn o.Value.String()\n\t\t}\n\t}\n\treturn path.Dir(depfile.FilePath)\n}", "func (c *common) GetPackage() string { return c.file.GetPackage() }", "func (pkg *goPackage) firstGoFile() string {\n\tgoSrcs := []platformStringsBuilder{\n\t\tpkg.library.sources,\n\t\tpkg.binary.sources,\n\t\tpkg.test.sources,\n\t}\n\tfor _, sb := range goSrcs {\n\t\tif sb.strs != nil {\n\t\t\tfor s := range sb.strs {\n\t\t\t\tif strings.HasSuffix(s, \".go\") {\n\t\t\t\t\treturn s\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}", "func (fd *File) GoPackagePath() string {\n\treturn fd.builder.GoPackagePath\n}", "func GoPackage(packageName string) string {\n\tif packageName == \"\" {\n\t\treturn \"\"\n\t}\n\tsplit := strings.Split(packageName, \".\")\n\treturn split[len(split)-1] + \"pb\"\n}", "func goPackageName(d *descriptor.FileDescriptorProto) (name string, explicit bool) {\n\t// Does the file have a \"go_package\" option?\n\tif _, pkg, ok := goPackageOption(d); ok {\n\t\treturn pkg, true\n\t}\n\n\t// Does the file have a package clause?\n\tif pkg := d.GetPackage(); pkg != \"\" {\n\t\treturn pkg, false\n\t}\n\t// Use the file base name.\n\treturn baseName(d.GetName()), false\n}", "func (d *FileDescriptor) goPackageName() (name string, explicit bool) {\n\t// Does the file have a \"go_package\" option?\n\tif _, pkg, ok := d.goPackageOption(); ok {\n\t\treturn pkg, true\n\t}\n\n\t// Does the file have a package clause?\n\tif pkg := d.GetPackage(); pkg != \"\" {\n\t\treturn pkg, false\n\t}\n\t// Use the file base name.\n\treturn baseName(d.GetName()), false\n}", "func (d *FileDescriptor) PackageName() string { return uniquePackageOf(d.FileDescriptorProto) }", "func (c *common) PackageName() string { return uniquePackageOf(c.file) }", "func (d *FileDescriptor) goFileName(pathType pathType) string {\n\tname := *d.Name\n\tif ext := path.Ext(name); ext == \".proto\" || ext == \".protodevel\" {\n\t\tname = name[:len(name)-len(ext)]\n\t}\n\tname += \".cobra.pb.go\"\n\n\tif pathType == pathTypeSourceRelative {\n\t\treturn name\n\t}\n\n\t// Does the file have a \"go_package\" option?\n\t// If it does, it may override the filename.\n\tif impPath, _, ok := d.goPackageOption(); ok && impPath != \"\" {\n\t\t// Replace the existing dirname with the declared import path.\n\t\t_, name = path.Split(name)\n\t\tname = path.Join(impPath, name)\n\t\treturn name\n\t}\n\n\treturn name\n}", "func (*GetProjectRequest) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{25}\n}", "func goFileName(d *descriptor.FileDescriptorProto) string {\n\tname := *d.Name\n\tif ext := path.Ext(name); ext == \".proto\" || ext == \".protodevel\" {\n\t\tname = name[:len(name)-len(ext)]\n\t}\n\tname += \".nrpc.go\"\n\n\t// Does the file have a \"go_package\" option?\n\t// If it does, it may override the filename.\n\tif impPath, _, ok := goPackageOption(d); ok && impPath != \"\" {\n\t\t// Replace the existing dirname with the declared import path.\n\t\t_, name = path.Split(name)\n\t\tname = path.Join(impPath, name)\n\t\treturn name\n\t}\n\n\treturn name\n}", "func (pp *protoPackage) pkgPath() string {\n\treturn strings.Replace(pp.Pkg, \".\", \"/\", -1)\n}", "func goPkg(fileName string) (string, error) {\n\tcontent, err := os.ReadFile(fileName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar pkgName string\n\tif match := goPkgOptRe.FindSubmatch(content); len(match) > 0 {\n\t\tpn, err := strconv.Unquote(string(match[1]))\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tpkgName = pn\n\t}\n\tif p := strings.IndexRune(pkgName, ';'); p > 0 {\n\t\tpkgName = pkgName[:p]\n\t}\n\treturn pkgName, nil\n}", "func (project Project) Package() (string, error) {\n\n\tif project.packageName != \"\" {\n\t\treturn project.packageName, nil\n\t}\n\n\tgoModPath := project.RelPath(GoModFileName)\n\tif !project.FileExists(goModPath) {\n\t\treturn \"\", errors.New(\"Failed to determine the package name for this project\")\n\t}\n\n\tb, err := ioutil.ReadFile(goModPath)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"Failed to read the go.mod file\")\n\t}\n\n\tmod, err := gomod.Parse(goModPath, b)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"Failed to parse the go.mod file\")\n\t}\n\n\tproject.packageName = strings.TrimSuffix(mod.Name, \"/\")\n\n\treturn project.packageName, nil\n\n}", "func (g *Generator) GoWrapFilePackage(depfile *fdep.DepFile) string {\n\tif g.PkgSource != nil {\n\t\tif p, ok := g.PkgSource.GetFilePkg(g, depfile); ok {\n\t\t\treturn p\n\t\t}\n\t}\n\n\treturn \"fw\" + fproto_wrap.BaseName(g.GoWrapPackage(depfile))\n}", "func (f *FileStruct) GetPersistPackageOption() string {\n\tif f.Desc == nil || f.Desc.GetOptions() == nil {\n\t\treturn \"\"\n\t}\n\tif proto.HasExtension(f.Desc.GetOptions(), persist.E_Package) {\n\t\tpkg, err := proto.GetExtension(f.Desc.GetOptions(), persist.E_Package)\n\t\tif err != nil {\n\t\t\tlogrus.WithError(err).Debug(\"Error\")\n\t\t\treturn \"\"\n\t\t}\n\t\t//logrus.WithField(\"pkg\", *pkg.(*string)).Info(\"Package\")\n\t\treturn *pkg.(*string)\n\t}\n\tlogrus.WithField(\"File Options\", f.Desc.GetOptions()).Debug(\"file options\")\n\treturn \"\"\n}", "func Which(s protoreflect.FullName) ProtoFile {\r\n\treturn wellKnownTypes[s]\r\n}", "func GetPackageName(source string) string {\n\tfileNode, err := parser.ParseFile(\"\", source, nil, parser.ImportsOnly)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\treturn fileNode.Name.Name()\n}", "func (*GetProjectResponse) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{26}\n}", "func (*Project) Descriptor() ([]byte, []int) {\n\treturn file_proto_carbon_proto_rawDescGZIP(), []int{0}\n}", "func ProtoFromFileDescriptor(d protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto {\n\tif imp, ok := d.(protoreflect.FileImport); ok {\n\t\td = imp.FileDescriptor\n\t}\n\ttype canProto interface {\n\t\tFileDescriptorProto() *descriptorpb.FileDescriptorProto\n\t}\n\tif res, ok := d.(canProto); ok {\n\t\treturn res.FileDescriptorProto()\n\t}\n\tif res, ok := d.(DescriptorProtoWrapper); ok {\n\t\tif fd, ok := res.AsProto().(*descriptorpb.FileDescriptorProto); ok {\n\t\t\treturn fd\n\t\t}\n\t}\n\treturn protodesc.ToFileDescriptorProto(d)\n}", "func goPackageOption(d *descriptor.FileDescriptorProto) (impPath, pkg string, ok bool) {\n\tpkg = d.GetOptions().GetGoPackage()\n\tif pkg == \"\" {\n\t\treturn\n\t}\n\tok = true\n\t// The presence of a slash implies there's an import path.\n\tslash := strings.LastIndex(pkg, \"/\")\n\tif slash < 0 {\n\t\treturn\n\t}\n\timpPath, pkg = pkg, pkg[slash+1:]\n\t// A semicolon-delimited suffix overrides the package name.\n\tsc := strings.IndexByte(impPath, ';')\n\tif sc < 0 {\n\t\treturn\n\t}\n\timpPath, pkg = impPath[:sc], impPath[sc+1:]\n\treturn\n}", "func (*CodeGeneratorResponse_File) Descriptor() ([]byte, []int) {\n\treturn file_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{2, 0}\n}", "func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto {\n\tp := &descriptorpb.FileDescriptorProto{\n\t\tName: proto.String(file.Path()),\n\t\tOptions: proto.Clone(file.Options()).(*descriptorpb.FileOptions),\n\t}\n\tif file.Package() != \"\" {\n\t\tp.Package = proto.String(string(file.Package()))\n\t}\n\tfor i, imports := 0, file.Imports(); i < imports.Len(); i++ {\n\t\timp := imports.Get(i)\n\t\tp.Dependency = append(p.Dependency, imp.Path())\n\t\tif imp.IsPublic {\n\t\t\tp.PublicDependency = append(p.PublicDependency, int32(i))\n\t\t}\n\t\tif imp.IsWeak {\n\t\t\tp.WeakDependency = append(p.WeakDependency, int32(i))\n\t\t}\n\t}\n\tfor i, locs := 0, file.SourceLocations(); i < locs.Len(); i++ {\n\t\tloc := locs.Get(i)\n\t\tl := &descriptorpb.SourceCodeInfo_Location{}\n\t\tl.Path = append(l.Path, loc.Path...)\n\t\tif loc.StartLine == loc.EndLine {\n\t\t\tl.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndColumn)}\n\t\t} else {\n\t\t\tl.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndLine), int32(loc.EndColumn)}\n\t\t}\n\t\tl.LeadingDetachedComments = append([]string(nil), loc.LeadingDetachedComments...)\n\t\tif loc.LeadingComments != \"\" {\n\t\t\tl.LeadingComments = proto.String(loc.LeadingComments)\n\t\t}\n\t\tif loc.TrailingComments != \"\" {\n\t\t\tl.TrailingComments = proto.String(loc.TrailingComments)\n\t\t}\n\t\tif p.SourceCodeInfo == nil {\n\t\t\tp.SourceCodeInfo = &descriptorpb.SourceCodeInfo{}\n\t\t}\n\t\tp.SourceCodeInfo.Location = append(p.SourceCodeInfo.Location, l)\n\n\t}\n\tfor i, messages := 0, file.Messages(); i < messages.Len(); i++ {\n\t\tp.MessageType = append(p.MessageType, ToDescriptorProto(messages.Get(i)))\n\t}\n\tfor i, enums := 0, file.Enums(); i < enums.Len(); i++ {\n\t\tp.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i)))\n\t}\n\tfor i, services := 0, file.Services(); i < services.Len(); i++ {\n\t\tp.Service = append(p.Service, ToServiceDescriptorProto(services.Get(i)))\n\t}\n\tfor i, exts := 0, file.Extensions(); i < exts.Len(); i++ {\n\t\tp.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i)))\n\t}\n\tif syntax := file.Syntax(); syntax != protoreflect.Proto2 {\n\t\tp.Syntax = proto.String(file.Syntax().String())\n\t}\n\treturn p\n}", "func (*PatchProject) Descriptor() ([]byte, []int) {\n\treturn file_determined_project_v1_project_proto_rawDescGZIP(), []int{4}\n}", "func (*Project) Descriptor() ([]byte, []int) {\n\treturn file_determined_project_v1_project_proto_rawDescGZIP(), []int{2}\n}", "func (d *FileDescriptor) goPackageOption() (impPath, pkg string, ok bool) {\n\tpkg = d.GetOptions().GetGoPackage()\n\tif pkg == \"\" {\n\t\treturn\n\t}\n\tok = true\n\t// The presence of a slash implies there's an import path.\n\tslash := strings.LastIndex(pkg, \"/\")\n\tif slash < 0 {\n\t\treturn\n\t}\n\timpPath, pkg = pkg, pkg[slash+1:]\n\t// A semicolon-delimited suffix overrides the package name.\n\tsc := strings.IndexByte(impPath, ';')\n\tif sc < 0 {\n\t\treturn\n\t}\n\timpPath, pkg = impPath[:sc], impPath[sc+1:]\n\treturn\n}", "func (*ProjectSimple) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{29}\n}", "func (*GoPackageInfo) Descriptor() ([]byte, []int) {\n\treturn file_kythe_proto_go_proto_rawDescGZIP(), []int{1}\n}", "func deduceGenPkgName(genFiles []*descriptor.FileDescriptorProto) (string, error) {\n\tvar genPkgName string\n\tfor _, f := range genFiles {\n\t\tname, explicit := goPackageName(f)\n\t\tif explicit {\n\t\t\tname = stringutils.CleanIdentifier(name)\n\t\t\tif genPkgName != \"\" && genPkgName != name {\n\t\t\t\t// Make sure they're all set consistently.\n\t\t\t\treturn \"\", errors.Errorf(\"files have conflicting go_package settings, must be the same: %q and %q\", genPkgName, name)\n\t\t\t}\n\t\t\tgenPkgName = name\n\t\t}\n\t}\n\tif genPkgName != \"\" {\n\t\treturn genPkgName, nil\n\t}\n\n\t// If there is no explicit setting, then check the implicit package name\n\t// (derived from the protobuf package name) of the files and make sure it's\n\t// consistent.\n\tfor _, f := range genFiles {\n\t\tname, _ := goPackageName(f)\n\t\tname = stringutils.CleanIdentifier(name)\n\t\tif genPkgName != \"\" && genPkgName != name {\n\t\t\treturn \"\", errors.Errorf(\"files have conflicting package names, must be the same or overridden with go_package: %q and %q\", genPkgName, name)\n\t\t}\n\t\tgenPkgName = name\n\t}\n\n\t// All the files have the same name, so we're good.\n\treturn genPkgName, nil\n}", "func GetFirstGoPath() string {\n\treturn strings.Split(os.Getenv(\"GOPATH\"), \":\")[0]\n}", "func lookupProjPath(protoAbs string) (result string) {\n\tlastIndex := len(protoAbs)\n\tcurPath := protoAbs\n\n\tfor lastIndex > 0 {\n\t\tif fileExist(curPath+\"/cmd\") && fileExist(curPath+\"/api\") {\n\t\t\tresult = curPath\n\t\t\treturn\n\t\t}\n\t\tlastIndex = strings.LastIndex(curPath, string(os.PathSeparator))\n\t\tcurPath = protoAbs[:lastIndex]\n\t}\n\tresult = \"\"\n\treturn\n}", "func Namespace(file *descriptor.FileDescriptorProto) string {\n\toptions := file.GetOptions()\n\n\t// When there is a namespace option defined we use it\n\tif options.PhpNamespace != nil {\n\t\treturn options.GetPhpNamespace()\n\t}\n\n\treturn Name(file.GetPackage())\n}", "func protobufName(f *ast.Field) string {\n\tfor _, attr := range f.Attrs {\n\t\tif strings.HasPrefix(attr.Text, \"@protobuf\") {\n\t\t\tfor _, str := range strings.Split(attr.Text[10:len(attr.Text)-1], \",\") {\n\t\t\t\tif strings.HasPrefix(str, \"name=\") {\n\t\t\t\t\treturn str[5:]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}", "func (*Project) Descriptor() ([]byte, []int) {\n\treturn file_management_proto_rawDescGZIP(), []int{79}\n}", "func (*Project) Descriptor() ([]byte, []int) {\n\treturn file_management_proto_rawDescGZIP(), []int{76}\n}", "func (*ExistingFile) Descriptor() ([]byte, []int) {\n\treturn file_protoconfig_go_kingpinv2_v1_extensions_proto_rawDescGZIP(), []int{1}\n}", "func getTmplFileDesc(fds []*descriptor.FileDescriptorProto) (string, *descriptor.FileDescriptorProto, error) {\n\tvar templateDescriptorProto *descriptor.FileDescriptorProto\n\tfor _, fd := range fds {\n\t\tif fd.GetOptions() == nil || !proto.HasExtension(fd.GetOptions(), tmpl.E_TemplateVariety) {\n\t\t\tcontinue\n\t\t}\n\t\tif templateDescriptorProto != nil {\n\t\t\treturn \"\", nil, fmt.Errorf(\n\t\t\t\t\"proto files %s and %s, both have the option %s. Only one proto file is allowed with this options\",\n\t\t\t\tfd.GetName(), templateDescriptorProto.GetName(), tmpl.E_TemplateVariety.Name)\n\t\t}\n\t\ttemplateDescriptorProto = fd\n\t}\n\n\tif templateDescriptorProto == nil {\n\t\treturn \"\", nil, fmt.Errorf(\"there has to be one proto file that has the extension %s\", tmpl.E_TemplateVariety.Name)\n\t}\n\n\tvar tmplName string\n\tif nameExt, err := proto.GetExtension(templateDescriptorProto.GetOptions(), tmpl.E_TemplateName); err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\n\t\t\t\"proto files %s is missing required template_name option\", templateDescriptorProto.GetName())\n\t} else if err := validateTmplName(*(nameExt.(*string))); err != nil {\n\t\treturn \"\", nil, err\n\t} else {\n\t\ttmplName = *(nameExt.(*string))\n\t}\n\n\treturn tmplName, templateDescriptorProto, nil\n}", "func generateFile(gen *protogen.Plugin, file *protogen.File) {\n\tfilename := file.GeneratedFilenamePrefix + \"_message.pb.go\"\n\tg := gen.NewGeneratedFile(filename, file.GoImportPath)\n\n\tg.P(\"// Code generated by protoc-gen-message-validator. DO NOT EDIT.\")\n\tg.P()\n\tg.P(\"package \", file.GoPackageName)\n\tg.P()\n\n\tfor _, message := range file.Messages {\n\t\tstructName := string(message.Desc.Name())\n\t\tprefix := strings.ToLower(string(structName[0]))\n\n\t\tfor _, subMessage := range message.Messages {\n\t\t\tif subMessage.Desc.IsMapEntry() {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tsubStructName := string(subMessage.Desc.Name())\n\t\t\tgenerateMessage(fmt.Sprintf(\"%s_%s\", structName, subStructName), prefix, subMessage, g)\n\t\t}\n\n\t\tgenerateMessage(structName, prefix, message, g)\n\t}\n}", "func (*AppGroup) Descriptor() ([]byte, []int) {\n\treturn file_common_proto_rawDescGZIP(), []int{1}\n}", "func (*UpdateProjectRequest) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{21}\n}", "func (*ProjectModel) Descriptor() ([]byte, []int) {\n\treturn file_determined_project_v1_project_proto_rawDescGZIP(), []int{3}\n}", "func (*Project) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_project_api_ocp_project_api_proto_rawDescGZIP(), []int{12}\n}", "func (s *Stub) GetProject() string {\n\treturn \"\"\n}", "func (*UpdateProjectResponse) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{22}\n}", "func guessPackageName(b *util.BuildCtxt, base string) string {\n\tcwd, err := os.Getwd()\n\tif err != nil {\n\t\treturn \"main\"\n\t}\n\n\tpkg, err := b.Import(base, cwd, 0)\n\tif err != nil {\n\t\t// There may not be any top level Go source files but the project may\n\t\t// still be within the GOPATH.\n\t\tif strings.HasPrefix(base, b.GOPATH) {\n\t\t\tp := strings.TrimPrefix(base, b.GOPATH)\n\t\t\treturn strings.Trim(p, string(os.PathSeparator))\n\t\t}\n\t}\n\n\treturn pkg.ImportPath\n}", "func GetGoPackage(url string) string {\n\tswitch {\n\tcase strings.Contains(url, \";\"):\n\t\tidx := strings.LastIndex(url, \";\")\n\t\treturn url[idx+1:]\n\tcase strings.Contains(url, \"/\"):\n\t\tidx := strings.LastIndex(url, \"/\")\n\t\treturn url[idx+1:]\n\tdefault:\n\t\treturn url\n\t}\n}", "func (g *Generator) GoWrapPackage(depfile *fdep.DepFile) string {\n\tif g.PkgSource != nil {\n\t\tif p, ok := g.PkgSource.GetPkg(g, depfile); ok {\n\t\t\treturn p\n\t\t}\n\t}\n\n\tfor _, o := range depfile.ProtoFile.Options {\n\t\tif o.Name == \"gowrap_package\" {\n\t\t\treturn o.Value.String()\n\t\t}\n\t}\n\n\t// prepend \"fpwrap\"\n\tfor _, o := range depfile.ProtoFile.Options {\n\t\tif o.Name == \"go_package\" {\n\t\t\treturn path.Join(\"fpwrap\", o.Value.String())\n\t\t}\n\t}\n\treturn path.Join(\"fpwrap\", path.Dir(depfile.FilePath))\n}", "func getFileExtensionBySdk(precompiledObjectPath string) (string, error) {\n\tsdk := strings.Split(precompiledObjectPath, string(os.PathSeparator))[0]\n\tvar extension string\n\tswitch sdk {\n\tcase pb.Sdk_SDK_JAVA.String():\n\t\textension = javaExtension\n\tcase pb.Sdk_SDK_PYTHON.String():\n\t\textension = pyExtension\n\tcase pb.Sdk_SDK_GO.String():\n\t\textension = goExtension\n\tcase pb.Sdk_SDK_SCIO.String():\n\t\textension = scioExtension\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"\")\n\t}\n\treturn extension, nil\n}", "func (p *Provider) GetProject() string {\n\to := p.opts\n\tif len(o.projects) > 1 {\n\t\tpanic(fmt.Sprintf(\n\t\t\t\"multiple projects not supported (%d specified)\", len(o.projects)))\n\t}\n\treturn o.projects[0]\n}", "func (*ListProjectsResponse_Project) Descriptor() ([]byte, []int) {\n\treturn file_web_proto_rawDescGZIP(), []int{1, 0}\n}", "func (*ProjectMember) Descriptor() ([]byte, []int) {\n\treturn file_management_proto_rawDescGZIP(), []int{78}\n}", "func (*GetUserProjectsRequest) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{27}\n}", "func (t *Type) fullGoPackageName() string {\n\tif t.qname.namespace != t.Namespace {\n\t\treturn t.qname.namespace.fullGoPackageName\n\t}\n\treturn \"\"\n}", "func (i Import) Package() string {\n\tif v := i.Alias; len(v) != 0 {\n\t\treturn v\n\t}\n\n\tif v := i.Path; len(v) != 0 {\n\t\tparts := strings.Split(v, \"/\")\n\t\tpkg := parts[len(parts)-1]\n\t\treturn pkg\n\t}\n\n\treturn \"\"\n}", "func (*CreateProjectResponse) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{18}\n}", "func (*CreateProjectRequest) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{17}\n}", "func (*Projects) Descriptor() ([]byte, []int) {\n\treturn file_management_proto_rawDescGZIP(), []int{78}\n}", "func (b *Buffer) FileType() string {\n\treturn b.Settings[\"filetype\"].(string)\n}", "func (*ProjectMember) Descriptor() ([]byte, []int) {\n\treturn file_management_proto_rawDescGZIP(), []int{81}\n}", "func (x *fastReflection_ModuleOptions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {\n\tswitch descriptor.FullName() {\n\tcase \"cosmos.autocli.v1.ModuleOptions.tx\":\n\t\tvalue := x.Tx\n\t\treturn protoreflect.ValueOfMessage(value.ProtoReflect())\n\tcase \"cosmos.autocli.v1.ModuleOptions.query\":\n\t\tvalue := x.Query\n\t\treturn protoreflect.ValueOfMessage(value.ProtoReflect())\n\tdefault:\n\t\tif descriptor.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.autocli.v1.ModuleOptions\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.autocli.v1.ModuleOptions does not contain field %s\", descriptor.FullName()))\n\t}\n}", "func (*DescribeProjectRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_project_api_ocp_project_api_proto_rawDescGZIP(), []int{8}\n}", "func GetProto(src string) (string, error) {\n\tparsed, err := url.Parse(src)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(parsed.Scheme) > 0 {\n\t\treturn parsed.Scheme, nil\n\t}\n\n\treturn \"\", nil\n}", "func (*NewProject) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_project_api_ocp_project_api_proto_rawDescGZIP(), []int{13}\n}", "func goPath() string {\n\tgpDefault := build.Default.GOPATH\n\tgps := filepath.SplitList(gpDefault)\n\n\treturn gps[0]\n}", "func (p *plugin) analyzeFile(f *descriptor.FileDescriptorProto) error {\n\tif f.GetSyntax() != \"proto3\" {\n\t\treturn fmt.Errorf(\"unsupported syntax '%s', must be 'proto3'\", f.GetSyntax())\n\t}\n\n\tfile := goFile{structs: map[string]goStruct{}}\n\n\tfor _, m := range f.GetMessageType() {\n\t\tif err := p.analyzeMessageType(file, []string{}, m); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to analyze message type '%s': %s\", m.GetName(), err.Error())\n\t\t}\n\t}\n\n\tif len(file.structs) > 0 {\n\t\tn := filepath.Base(f.GetName())\n\t\tn = strings.TrimSuffix(n, filepath.Ext(n))\n\t\tp.targetFiles[n+\".pb.go\"] = file\n\t}\n\n\treturn nil\n}", "func (resolver *NpmResolver) ParsePkgFile(pkgFile string) (*Package, error) {\n\tcontent, err := ioutil.ReadFile(pkgFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar packageInfo Package\n\tif err := json.Unmarshal(content, &packageInfo); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &packageInfo, nil\n}", "func getPackageName(datatypeName string) string {\n\tparts := strings.Split(datatypeName, \".\")\n\tif len(parts) == 1 {\n\t\treturn \"\" // no package name\n\t}\n\n\toffset := 0\n\tfor i, p := range parts {\n\t\tif unicode.IsUpper(rune(p[0])) {\n\t\t\tbreak\n\t\t}\n\n\t\toffset += len(p)\n\t\tif i > 0 {\n\t\t\toffset += 1 // also account for the '.'\n\t\t}\n\t}\n\n\treturn datatypeName[:offset]\n}", "func (pp *protoPackage) absPath() string {\n\treturn path.Join(pp.Path, pp.pkgPath())\n}", "func (f *tmplFuncs) resolvePkgPath(pkg string) string {\n\t// Test this proto file itself:\n\tif stripExt(filepath.Base(*f.f.Name)) == pkg {\n\t\treturn *f.f.Name\n\t}\n\n\t// Test each dependency:\n\tfor _, p := range f.f.Dependency {\n\t\tif stripExt(filepath.Base(p)) == pkg {\n\t\t\treturn p\n\t\t}\n\t}\n\treturn \"\"\n}", "func (*MyCompany) Descriptor() ([]byte, []int) {\n\treturn file_parser_company_proto_rawDescGZIP(), []int{21}\n}", "func IsCommonProto(f *desc.FileDescriptor) bool {\n\tp := f.GetPackage()\n\tfor _, prefix := range []string{\"google.api\", \"google.protobuf\", \"google.rpc\", \"google.longrunning\"} {\n\t\tif strings.HasPrefix(p, prefix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func (i *Import) GetTFVCProject() string {\n\tif i == nil || i.TFVCProject == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.TFVCProject\n}", "func (*Program) Descriptor() ([]byte, []int) {\n\treturn file_proto_common_proto_rawDescGZIP(), []int{1}\n}", "func (*DescribeProjectResponse) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_project_api_ocp_project_api_proto_rawDescGZIP(), []int{9}\n}", "func (*DcsProject) Descriptor() ([]byte, []int) {\n\treturn file_dcs_model_proto_rawDescGZIP(), []int{2}\n}", "func (o *ProformaArray) GetProject() string {\n\tif o == nil || o.Project == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Project\n}", "func (*CheckProjectTokenResponse) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{33}\n}", "func (*ProjectColumn) Descriptor() ([]byte, []int) {\n\treturn file_determined_project_v1_project_proto_rawDescGZIP(), []int{0}\n}", "func getCallerPackage() string {\n\tconst replayModeRecordModeCaller = 3\n\tc := caller.Get(replayModeRecordModeCaller)\n\tpkg := strings.SplitN(c, \".\", 2)[0]\n\treturn path.Base(pkg)\n}", "func (pr *PkgDecoder) PkgPath() string { return pr.pkgPath }", "func (b *baseBuilder) GetFile() *FileBuilder {\n\tp := b.parent\n\tfor p != nil {\n\t\tif fb, ok := p.(*FileBuilder); ok {\n\t\t\treturn fb\n\t\t}\n\t\tp = p.GetParent()\n\t}\n\treturn nil\n}", "func GoServicePackagePath(name string) string {\n\treturn filepath.Join(PaceBase, ServiceBase, name)\n}", "func (*UpdateProjectRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_ocp_project_api_ocp_project_api_proto_rawDescGZIP(), []int{10}\n}", "func GetPkgName() string {\n\t_, filePath, _, _ := runtime.Caller(0)\n\tfile, _ := os.Open(filePath)\n\tr := bufio.NewReader(file)\n\tline, _, _ := r.ReadLine()\n\tpkgName := bytes.TrimPrefix(line, []byte(\"package \"))\n\n\treturn string(pkgName)\n}", "func (p *Parser) Package() string {\n\treturn p.asTree.Name.Name\n}", "func ProtoServiceName(fullname string) Option {\n\treturn func(a *appOptions) {\n\t\ta.protoService = fullname\n\t}\n}", "func (*Projects) Descriptor() ([]byte, []int) {\n\treturn file_management_proto_rawDescGZIP(), []int{75}\n}", "func packageFilename(pwd, relativePath string) string {\n\tfullPath := filepath.Join(pwd, relativePath)\n\treturn strings.TrimPrefix(strings.TrimPrefix(fullPath, filepath.Join(gopath(), \"src\")), \"/\")\n}", "func (*CheckProjectTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{32}\n}", "func (*ProjectID) Descriptor() ([]byte, []int) {\n\treturn file_management_proto_rawDescGZIP(), []int{6}\n}", "func (*ProjectID) Descriptor() ([]byte, []int) {\n\treturn file_management_proto_rawDescGZIP(), []int{6}\n}", "func (o *ProformaArray) GetProjectOk() (*string, bool) {\n\tif o == nil || o.Project == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Project, true\n}", "func getPackageName(f string) string {\n\tfor {\n\t\tlastPeriod := strings.LastIndex(f, \".\")\n\t\tlastSlash := strings.LastIndex(f, \"/\")\n\t\tif lastPeriod > lastSlash {\n\t\t\tf = f[:lastPeriod]\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn f\n}", "func Project(ctx context.Context, project string) (*configpb.ProjectConfig, error) {\n\tconfigs, err := Projects(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif c, ok := configs[project]; ok {\n\t\treturn c, nil\n\t}\n\treturn nil, ErrNotFoundProjectConfig\n}", "func (*GetMyRequest) Descriptor() ([]byte, []int) {\n\treturn file_parser_company_proto_rawDescGZIP(), []int{6}\n}", "func (*GlobalOptions) Descriptor() ([]byte, []int) {\n\treturn file_github_com_google_cloudprober_targets_gce_proto_config_proto_rawDescGZIP(), []int{3}\n}", "func (pi *PackageInfo) FileVName(file *ast.File) *spb.VName {\n\tif v := pi.fileVName[file]; v != nil {\n\t\treturn v\n\t}\n\tv := proto.Clone(pi.VName).(*spb.VName)\n\tv.Language = \"\"\n\tv.Signature = \"\"\n\tv.Path = pi.FileSet.Position(file.Pos()).Filename\n\treturn v\n}" ]
[ "0.6514599", "0.6418956", "0.62568474", "0.6100058", "0.6059389", "0.6033528", "0.5760218", "0.571393", "0.56766814", "0.56747204", "0.55886865", "0.55810106", "0.55710924", "0.5528127", "0.5502348", "0.55021805", "0.5456921", "0.5454185", "0.54367715", "0.54307157", "0.54025465", "0.53424656", "0.5329483", "0.5327733", "0.53020066", "0.52819157", "0.52795607", "0.52257407", "0.52240294", "0.51456493", "0.5137637", "0.5134006", "0.5133966", "0.51120484", "0.5107064", "0.50847185", "0.5082025", "0.507457", "0.50681937", "0.5033462", "0.50315183", "0.50245786", "0.5019538", "0.5017327", "0.50053775", "0.50039554", "0.49943617", "0.49909803", "0.49890676", "0.49804884", "0.49707755", "0.4931849", "0.49237567", "0.4921064", "0.4905122", "0.49045667", "0.49015555", "0.49012348", "0.4892581", "0.4889273", "0.48874435", "0.48817107", "0.48771524", "0.4876309", "0.48685285", "0.48641378", "0.4861054", "0.48610055", "0.48546317", "0.4849436", "0.48461854", "0.48250479", "0.4822479", "0.48205945", "0.48192737", "0.48135585", "0.48060772", "0.4804189", "0.48035768", "0.48003185", "0.47990838", "0.4787936", "0.47851935", "0.47817233", "0.4781146", "0.47775137", "0.47767115", "0.4776245", "0.47737917", "0.47712553", "0.476954", "0.47676048", "0.47668436", "0.47668436", "0.47661626", "0.47600132", "0.47533566", "0.47468054", "0.47438252", "0.4743572" ]
0.7273096
0
NewQueueManager instantiates a new QueueManager object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed
func NewQueueManager(name string, clusters []string, aliasQueues []AliasQueue, remoteQueues []RemoteQueue, clusterQueues []ClusterQueue, ) *QueueManager { this := QueueManager{} this.Name = name this.Clusters = clusters this.AliasQueues = aliasQueues this.RemoteQueues = remoteQueues this.ClusterQueues = clusterQueues return &this }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewQueueManager(logger log.Logger, cfg config.QueueConfig, externalLabels labels.Labels, relabelConfigs []*relabel.Config, client StorageClient, flushDeadline time.Duration) *QueueManager {\n\tif logger == nil {\n\t\tlogger = log.NewNopLogger()\n\t} else {\n\t\tlogger = log.With(logger, \"queue\", client.Name())\n\t}\n\tt := &QueueManager{\n\t\tlogger: logger,\n\t\tflushDeadline: flushDeadline,\n\t\tcfg: cfg,\n\t\texternalLabels: externalLabels,\n\t\trelabelConfigs: relabelConfigs,\n\t\tclient: client,\n\t\tqueueName: client.Name(),\n\n\t\tlogLimiter: rate.NewLimiter(logRateLimit, logBurst),\n\t\tnumShards: cfg.MinShards,\n\t\treshardChan: make(chan int),\n\t\tquit: make(chan struct{}),\n\n\t\tsamplesIn: newEWMARate(ewmaWeight, shardUpdateDuration),\n\t\tsamplesOut: newEWMARate(ewmaWeight, shardUpdateDuration),\n\t\tsamplesOutDuration: newEWMARate(ewmaWeight, shardUpdateDuration),\n\t}\n\tt.shards = t.newShards(t.numShards)\n\tnumShards.WithLabelValues(t.queueName).Set(float64(t.numShards))\n\tshardCapacity.WithLabelValues(t.queueName).Set(float64(t.cfg.Capacity))\n\n\t// Initialize counter labels to zero.\n\tsentBatchDuration.WithLabelValues(t.queueName)\n\tsucceededSamplesTotal.WithLabelValues(t.queueName)\n\tfailedSamplesTotal.WithLabelValues(t.queueName)\n\tdroppedSamplesTotal.WithLabelValues(t.queueName)\n\n\treturn t\n}", "func NewQueueManager(q amboy.Queue) Manager {\n\treturn &queueManager{\n\t\tqueue: q,\n\t}\n}", "func NewQueue() *Queue {\n return &Queue{member: make([]interface{}, 0)}\n}", "func NewQueueManagerWithDefaults() *QueueManager {\n\tthis := QueueManager{}\n\treturn &this\n}", "func NewQueue() Queue {\n\treturn Queue{}\n}", "func NewQueue(name string, itemType reflect.Type, maxQueueSize uint32) Queue {\n\tq := queue{\n\t\tname: name,\n\t\titemType: itemType,\n\t\tchannel: make(chan interface{}, maxQueueSize),\n\t}\n\treturn &q\n}", "func NewManager(h Handler,\n\tusername string,\n\tpassword string,\n\tbrokerIp string,\n\tbrokerPort int,\n\texchange string,\n\tqueueName string,\n\tworkers int,\n\tallocate bool,\n\tmanagerName string,\n\thandleFunction handlerFunction,\n\tlogLevel string,\n\tnet catalogue.BaseNetworkInt,\n\timg catalogue.BaseImageInt) (*Manager, error) {\n\n\tmanager := &Manager{\n\t\tConnection: nil,\n\t\tChannel: nil,\n\t\tallocate: allocate,\n\t\tworkers: workers,\n\t\terrorChan: make(chan error),\n\t\tlogger: GetLogger(managerName, logLevel),\n\t\thandlerFunction: handleFunction,\n\t\thandler: h,\n\t\timage: img,\n\t\tnetwork: net,\n\t}\n\n\terr := setupManager(username, password, brokerIp, brokerPort, manager, exchange, queueName)\n\tif err != nil {\n\t\tmanager.logger.Errorf(\"Error while setup the amqp thing: %v\", err)\n\t\treturn nil, err\n\t}\n\tmanager.queueName = queueName\n\treturn manager, nil\n}", "func NewQueue(name string) *Queue {\n\tredisClient := GetRedisClientFromConfig()\n\tqueue := &Queue{Name: name, RedisClient: redisClient}\n\treturn queue\n}", "func NewQueue(args []func(http.ResponseWriter, *http.Request) (http.ResponseWriter, *http.Request)) *Queue {\n\tq := &Queue{}\n\tfor _, f := range args {\n\t\tq.list = append(q.list, f)\n\t}\n\treturn q\n}", "func newQueueMeta(conf *Conf) *queueMeta {\n\treturn &queueMeta{conf: conf}\n}", "func NewQueue(ctx context.Context, queueID string, db *sql.DB, conf QueueConfig) (*Queue, error) {\n\tq := &Queue{ID: queueID}\n\tq.repo = repo.NewRepository(db)\n\tq.PollRate = 100 * time.Millisecond // Default\n\tq.queueSize = 10000 // Default\n\tq.retries = 3 // Default\n\tq.IsMultiQueue = conf.IsMultiQueue\n\tq.baseDelay = 3 * time.Second // Default\n\n\tif conf.PollingRate > 0 {\n\t\tq.PollRate = conf.PollingRate\n\t}\n\tif conf.Qsize > 0 {\n\t\tq.queueSize = conf.Qsize\n\t}\n\tif conf.BaseDelay > 0 {\n\t\tq.baseDelay = conf.BaseDelay\n\t}\n\tif conf.Retries >= 0 {\n\t\tq.retries = conf.Retries\n\t}\n\t// Multilevel Queue/channel created\n\ttemp := mlQueue{}\n\ttemp.notifier = make([]chan JobChan, 1)\n\ttemp.notifier[0] = make(chan JobChan, q.queueSize)\n\ttemp.total = 1\n\tq.mq = temp\n\n\tm := make(map[string][]worker.Worker)\n\tq.workers = m\n\tvar wg sync.WaitGroup\n\tq.wg = &wg\n\n\t// resume stopped jobs\n\terr := q.ResumePendingJobs(ctx)\n\tif err != nil {\n\t\tlogger.Log.Error(\"Unable to resume jobs from bucket: %s\", zap.Error(err))\n\t\t// Don't fail out, this isn't really fatal. But maybe it should be?\n\t}\n\treturn q, nil\n}", "func MyQueueConstructor() MyQueue {\n\treturn MyQueue{}\n}", "func NewQueue(maximumCapacity int, initialCapacity int, factory TokenFactory) *Queue {\n\tq := &Queue{\n\t\tmaxCapacity: maximumCapacity,\n\t\tavailableTokens: make(chan (Token), maximumCapacity),\n\t\tcommittedTokens: make(chan (Token), maximumCapacity),\n\t\tdiscardTokens: make(chan (Token), maximumCapacity),\n\t\tcloseTokens: make(chan (Token)),\n\t}\n\n\tfor i := 0; i < maximumCapacity; i++ {\n\t\ttoken := factory()\n\t\tif token == nil {\n\t\t\treturn nil\n\t\t}\n\t\tq.discardTokens <- token\n\t\tq.validTokens = append(q.validTokens, token)\n\t}\n\n\tq.EnableDisableTokens(initialCapacity)\n\n\treturn q\n}", "func NewQueue(l int) *Queue {\n\tif l == -1 {\n\t\treturn &Queue{\n\t\t\tQueue: make([]types.Event, 0),\n\t\t\tL: int(^uint(0) >> 1), // max integer value, architecture independent\n\t\t}\n\t}\n\tq := &Queue{\n\t\tQueue: make([]types.Event, 0, l),\n\t\tL: l,\n\t}\n\tlog.WithFields(log.Fields{\"Capacity\": q.L}).Debugf(\"Creating queue\")\n\treturn q\n}", "func New() Manager {\n\treturn Manager{\n\t\tState: make(map[string]string),\n\t\tClientHolder: make(map[string]utils.Set),\n\t\tClientQueue: make(map[string]utils.Queue),\n\t}\n}", "func setupManager(username string, password string, brokerIp string, brokerPort int, manager *Manager, exchange string, queueName string) error {\n\tamqpURI := getAmqpUri(username, password, brokerIp, brokerPort)\n\tmanager.logger.Debugf(\"dialing %s\", amqpURI)\n\tvar err error\n\tmanager.Connection, err = amqp.Dial(amqpURI)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanager.logger.Debugf(\"got Connection, getting Channel\")\n\tmanager.Channel, err = manager.Connection.Channel()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanager.logger.Debugf(\"got Channel, declaring Exchange (%q)\", exchange)\n\n\tmanager.logger.Debugf(\"declared Exchange, declaring Queue %q\", queueName)\n\tqueue, err := manager.Channel.QueueDeclare(\n\t\tqueueName,\n\t\ttrue,\n\t\ttrue,\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanager.logger.Debugf(\"declared Queue (%q, %d messages, %d consumers), binding to Exchange\",\n\t\tqueue.Name, queue.Messages, queue.Consumers)\n\n\tif err = manager.Channel.QueueBind(\n\t\tqueue.Name, // name of the queue\n\t\tqueue.Name, // bindingKey\n\t\texchange, // sourceExchange\n\t\tfalse, // noWait\n\t\tnil, // arguments\n\t); err != nil {\n\t\treturn err\n\t}\n\n\tmanager.logger.Debug(\"Queue bound to Exchange, starting Consume\")\n\treturn nil\n}", "func New(name string, c config.Config) *Queue {\n\treturn &Queue{\n\t\tname: name,\n\t\tconf: c,\n\t}\n}", "func NewQueue(action func(interface{}) error) *QueueWorker {\n\treturn &QueueWorker{\n\t\taction: action,\n\t\tlatch: &Latch{},\n\t\tmaxWork: DefaultQueueWorkerMaxWork,\n\t}\n}", "func New(cfg Config, pubSub pubSub, metrics metricsProvider) (*Queue, error) {\n\tmsgChan, err := pubSub.SubscribeWithOpts(context.Background(), topic, spi.WithPool(cfg.PoolSize))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"subscribe to topic [%s]: %w\", topic, err)\n\t}\n\n\tq := &Queue{\n\t\tpubSub: pubSub,\n\t\tmsgChan: msgChan,\n\t\tjsonMarshal: json.Marshal,\n\t\tjsonUnmarshal: json.Unmarshal,\n\t\tmetrics: metrics,\n\t}\n\n\tq.Lifecycle = lifecycle.New(\"operation-queue\",\n\t\tlifecycle.WithStart(q.start),\n\t\tlifecycle.WithStop(q.stop),\n\t)\n\n\tq.Start()\n\n\treturn q, nil\n}", "func NewQueue(maxWorkers int, maxQueue int) *Queue {\n\tq := make(chan Job, maxQueue)\n\treturn &Queue{\n\t\tq,\n\t\ttrue,\n\t\t&Dispatcher{\n\t\t\tjobQueue: q,\n\t\t\tworkerPool: make(chan chan Job, maxWorkers),\n\t\t\tMaxWorkers: maxWorkers,\n\t\t},\n\t}\n}", "func (queue *Queue) Init() (err error) {\n\tclient := queue.GetClient()\n\n\tparams := &sqs.CreateQueueInput{\n\t\tQueueName: aws.String(queue.Name + deadLetterQueueSuffix),\n\t\tAttributes: map[string]*string{\n\t\t\t\"MessageRetentionPeriod\": aws.String(\"1209600\"),\n\t\t},\n\t}\n\tresp, err := client.CreateQueue(params)\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"queueName\": queue.Name,\n\t\t\t\"error\": err,\n\t\t}).Error(\"Createing the dead letter queue\")\n\t\treturn\n\t}\n\n\tqueue.DeadLetterQueueURL = *resp.QueueUrl\n\tlog.WithFields(log.Fields{\n\t\t\"QueueUrl\": queue.DeadLetterQueueURL,\n\t}).Info(\"Dead Letter Queue initialized\")\n\n\tqueueArnAttributeName := \"QueueArn\"\n\tdeadLetterQueueAttributes, err := queue.GetAttributesByQueueURL(queue.DeadLetterQueueURL, []*string{&queueArnAttributeName})\n\tif err != nil {\n\t\treturn\n\t}\n\tredrivePolicy := &RedrivePolicy{\n\t\tMaxReceiveCount: MaxReceiveCountBeforeDead,\n\t\tDeadLetterTargetArn: *deadLetterQueueAttributes.Attributes[queueArnAttributeName],\n\t}\n\tredrivePolicyString, err := redrivePolicy.GetAsAWSString()\n\tif err != nil {\n\t\treturn\n\t}\n\tparams = &sqs.CreateQueueInput{\n\t\tQueueName: aws.String(queue.Name),\n\t\tAttributes: map[string]*string{\n\t\t\t\"RedrivePolicy\": redrivePolicyString,\n\t\t\t\"MessageRetentionPeriod\": aws.String(\"1209600\"),\n\t\t},\n\t}\n\tresp, err = client.CreateQueue(params)\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"queueName\": queue.Name,\n\t\t\t\"error\": err,\n\t\t}).Error(\"Createing the queue\")\n\t\treturn\n\t}\n\n\tqueue.URL = *resp.QueueUrl\n\tlog.WithFields(log.Fields{\n\t\t\"QueueUrl\": queue.URL,\n\t}).Info(\"Queue initialized\")\n\n\treturn\n}", "func NewQueue(maxQueueSize, maxFlowSize uint64, helper Interface) *Queue {\n\tif maxFlowSize > maxQueueSize {\n\t\tpanic(\"MaxFlowSize > MaxQueueSize\")\n\t}\n\n\tif helper == nil {\n\t\tpanic(\"helper is nil\")\n\t}\n\n\tq := new(Queue)\n\tq.cond.L = &q.lock\n\tq.maxQueueSize = maxQueueSize\n\tq.maxFlowSize = maxFlowSize\n\tq.helper = helper\n\tq.flows = make(map[uint64]*flowInfo)\n\n\treturn q\n}", "func (t *OpenconfigQos_Qos_Queues) NewQueue(Name string) (*OpenconfigQos_Qos_Queues_Queue, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Queue == nil {\n\t\tt.Queue = make(map[string]*OpenconfigQos_Qos_Queues_Queue)\n\t}\n\n\tkey := Name\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Queue[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Queue\", key)\n\t}\n\n\tt.Queue[key] = &OpenconfigQos_Qos_Queues_Queue{\n\t\tName: &Name,\n\t}\n\n\treturn t.Queue[key], nil\n}", "func NewQueue(action WorkAction, options ...QueueOption) *Queue {\n\tq := Queue{\n\t\tLatch: NewLatch(),\n\t\tAction: action,\n\t\tContext: context.Background(),\n\t\tMaxWork: DefaultQueueMaxWork,\n\t\tParallelism: runtime.NumCPU(),\n\t}\n\tfor _, option := range options {\n\t\toption(&q)\n\t}\n\treturn &q\n}", "func New() *Queue {\r\n\treturn &Queue{nil,nil,0}\r\n}", "func NewQueue(ctx *pulumi.Context,\n\tname string, args *QueueArgs, opts ...pulumi.ResourceOption) (*Queue, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.HoursOfOperationArn == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'HoursOfOperationArn'\")\n\t}\n\tif args.InstanceArn == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'InstanceArn'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Queue\n\terr := ctx.RegisterResource(\"aws-native:connect:Queue\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func newQueueService(c *orgbot.Config) (*queueService, error) {\n\tsess, err := cmd.NewAWSSession()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &queueService{\n\t\tconfig: c,\n\t\tsqsClient: sqs.New(sess),\n\t}, nil\n\n}", "func NewQueue(storage Storage, reQueueTimeout time.Duration) Queue {\n\tif reQueueTimeout < 1 {\n\t\treQueueTimeout = time.Minute * 30\n\t}\n\n\tname := \"gocelery\"\n\tq := &queue{\n\t\tstorage: storage,\n\t\thead: 0,\n\t\ttail: 0,\n\t\trequeueTimeout: reQueueTimeout,\n\t\tqueuePrefix: fmt.Sprintf(\"%s-queue-\", name),\n\t\tqueueAckPrefix: fmt.Sprintf(\"%s-ack-\", name),\n\t}\n\n\t// restore the old state from the DB\n\tq.loadHeadTail()\n\treturn q\n}", "func New(mqURL string) (models.MessageQueue, error) {\n\tmq, err := newmq(mqURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &metricMQ{mq}, nil\n}", "func NewQueue(id string, persistent bool, conn net.Conn) (Queue, error) {\n\tservice := broker.GetService(ServiceName).(*QueueService)\n\treturn service.newQueue(id, persistent, conn)\n}", "func NewQueue(newNode *node.Node) *Queue {\n\tq := Queue{size: 0, final: newNode}\n\treturn &q\n}", "func New(cb Done, transport http.RoundTripper) *Manager {\n\treturn &Manager{\n\t\tkeys: sets.NewString(),\n\t\tcb: cb,\n\t\ttransport: transport,\n\t}\n}", "func NewQueue() *Queue {\n\treturn &Queue{}\n}", "func NewQueue() *Queue {\n\treturn &Queue{}\n}", "func NewQueue() *Queue {\n\treturn &Queue{nil, nil, 0}\n}", "func New() Queue {\n\treturn Queue{list: linkedlist.New()}\n}", "func New(name string) (*Queue, error) {\n\tqueue := Queue{Name: name}\n\terr := queue.Init()\n\n\treturn &queue, err\n}", "func NewQueue(\n\tservers []string,\n\topts QueueOptions,\n) (Queue, error) {\n\tq, err := newQueue(servers, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tq.initConnections(servers)\n\tgo q.reportMetrics()\n\n\treturn q, nil\n}", "func New(mqURL string) (models.MessageQueue, error) {\n\t// Play with URL schemes here: https://play.golang.org/p/xWAf9SpCBW\n\tu, err := url.Parse(mqURL)\n\tif err != nil {\n\t\tlogrus.WithError(err).WithFields(logrus.Fields{\"url\": mqURL}).Fatal(\"bad MQ URL\")\n\t}\n\tlogrus.WithFields(logrus.Fields{\"mq\": u.Scheme}).Debug(\"selecting MQ\")\n\tswitch u.Scheme {\n\tcase \"memory\":\n\t\treturn NewMemoryMQ(), nil\n\tcase \"redis\":\n\t\treturn NewRedisMQ(u)\n\tcase \"bolt\":\n\t\treturn NewBoltMQ(u)\n\t}\n\tif strings.HasPrefix(u.Scheme, \"ironmq\") {\n\t\treturn NewIronMQ(u), nil\n\t}\n\n\treturn nil, fmt.Errorf(\"mq type not supported %v\", u.Scheme)\n}", "func newQueue() *Queue {\n\tl := list.New()\n\treturn &Queue{Elements: l}\n}", "func New() *Queue {\n\treturn &Queue{nil, nil, 0}\n}", "func New() *Queue {\n\treturn &Queue{nil, nil, 0}\n}", "func New(hint int) *Queue {\n\treturn &Queue{\n\t\titems: make([]interface{}, 0, hint),\n\t}\n}", "func Constructor() MyQueue {\n\treturn Myqueue{list: listNew()}\n}", "func New(delegate Delegate, settings Settings) (*Queue, error) {\n\tconst op = \"pq/new\"\n\n\tif delegate == nil {\n\t\treturn nil, errOp(op).of(InvalidParam).report(\"delegate must not be nil\")\n\t}\n\n\taccessor, errKind := makeAccess(delegate)\n\tif errKind != NoError {\n\t\treturn nil, errOp(op).of(errKind)\n\t}\n\n\tpageSize := delegate.PageSize()\n\n\tq := &Queue{\n\t\taccessor: accessor,\n\t\tsettings: settings,\n\t\tpagePool: newPagePool(pageSize),\n\t}\n\n\t// use pointer address as ID for correlating error messages\n\tq.id = queueID(uintptr(unsafe.Pointer(q)))\n\taccessor.quID = q.id\n\n\trootBuf, err := q.accessor.ReadRoot()\n\tif err != nil {\n\t\treturn nil, wrapErr(op, err).of(InitFailed).\n\t\t\treport(\"failed to read queue header\")\n\t}\n\n\troot := castQueueRootPage(rootBuf[:])\n\tif root.version.Get() != queueVersion {\n\t\tcause := &Error{\n\t\t\tkind: InitFailed,\n\t\t\tmsg: fmt.Sprintf(\"queue version %v\", root.version.Get()),\n\t\t}\n\t\treturn nil, wrapErr(op, cause).of(InitFailed)\n\t}\n\n\ttracef(\"open queue: %p (pageSize: %v)\\n\", q, pageSize)\n\ttraceQueueHeader(root)\n\n\tq.version = root.version.Get()\n\tq.hdrOffset = q.accessor.RootFileOffset()\n\tq.onInit()\n\treturn q, nil\n}", "func New() *Queue {\n\tq := new(Queue)\n\tq.length = 0\n\tq.s1 = stack.New()\n\tq.s2 = stack.New()\n\n\treturn q\n}", "func (t *OpenconfigQos_Qos_Interfaces_Interface_Input_Queues) NewQueue(Name string) (*OpenconfigQos_Qos_Interfaces_Interface_Input_Queues_Queue, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Queue == nil {\n\t\tt.Queue = make(map[string]*OpenconfigQos_Qos_Interfaces_Interface_Input_Queues_Queue)\n\t}\n\n\tkey := Name\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Queue[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Queue\", key)\n\t}\n\n\tt.Queue[key] = &OpenconfigQos_Qos_Interfaces_Interface_Input_Queues_Queue{\n\t\tName: &Name,\n\t}\n\n\treturn t.Queue[key], nil\n}", "func NewQueue(queueCapacity int) (*Queue, error) {\n\tif queueCapacity < 0 {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"negative capacity value: %d\", queueCapacity)\n\t}\n\n\tdata := make([]interface{}, 0, queueCapacity)\n\n\treturn &Queue{\n\t\tdata: data,\n\t}, nil\n}", "func NewQueue() *Queue {\n\treturn new(Queue).InitQueueNode()\n}", "func New(ctx context.Context, cfg models.Config) (*Queue, error) {\n\tconn, err := connect(ctx, cfg)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to connect to RabbitMQ \")\n\t}\n\n\tch, err := conn.Channel()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to open a channel \")\n\t}\n\n\t_, err = ch.QueueDeclare(\"ItemQueue\", false, false, false, false, nil)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to declare a queue \")\n\t}\n\n\treturn &Queue{ch, conn}, nil\n}", "func NewQueue() *Queue {\n\tqueue := &Queue{\n\t\tcontents: make([]interface{}, 1),\n\t\tstart: -1,\n\t\tend: -1,\n\t\tlength: 0,\n\t}\n\n\treturn queue\n}", "func NewAPIRequestManager() *APIRequestManager {\n\treturn &APIRequestManager{\n\t\tqueue: make(chan *WorkerItem, 10),\n\t}\n}", "func NewQueue(queueID uint16, handler PacketHandler, cfg *QueueConfig) *Queue {\n\tif cfg == nil {\n\t\tcfg = &QueueConfig{}\n\t}\n\tq := &Queue{\n\t\tID: queueID,\n\t\thandler: handler,\n\t\tcfg: cfg,\n\t}\n\tqueueRegistry.Register(queueID, q)\n\treturn q\n}", "func newJobQueue(ctx context.Context, consumerCount, length int) *jobQueue {\n\teg, selfCtx := errgroup.WithContext(ctx)\n\treturn &jobQueue{\n\t\tctx: selfCtx,\n\t\tmsgq: make(chan *restoreSchemaJob, length),\n\t\tconsumerCount: consumerCount,\n\t\teg: eg,\n\t}\n}", "func NewManager(ps common.PubsubInterface, primaryCapacity int, overflowCapacity int) *Manager {\n\tshelves := map[string]*primaryShelf{\n\t\t\"hot\": NewPrimaryShelf(primaryCapacity),\n\t\t\"cold\": NewPrimaryShelf(primaryCapacity),\n\t\t\"frozen\": NewPrimaryShelf(primaryCapacity),\n\t}\n\toverflow := NewOverflowShelf(overflowCapacity, []string{\"hot\", \"cold\", \"frozen\"})\n\treturn &Manager{shelves, overflow, ps}\n}", "func Constructor() MyQueue {\n\treturn MyQueue{}\n}", "func Constructor() MyQueue {\n\treturn MyQueue{}\n}", "func New() *queue {\n\treturn &queue{\n\t\titems: make([]item, DefaultCapacity),\n\t\tcapacity: DefaultCapacity,\n\t}\n}", "func New(cfg config.Queue, n notifier) *Queue {\n\tq := &Queue{\n\t\taddCh: make(chan struct{}, cfg.QueueSize),\n\t\tpopCh: make(chan struct{}, cfg.GoRoutinesSize),\n\t\taddMessage: make(chan entity.NotifierMessage, 1),\n\t\tpopMessage: make(chan entity.NotifierMessage, 1),\n\t\tnotifier: n,\n\t}\n\n\tgo q.pop()\n\tgo q.add()\n\n\treturn q\n}", "func New(queueName string) bus.MessageQueue {\n\tmq := new(messageQueue)\n\tmq.queue = queueFactory(queueName)\n\n\treturn mq\n}", "func NewQueue(qname string, taskId string) (*Queue, error) {\n q := &Queue{}\n q.StdoutChan = make(chan []byte, QUEUE_SIZE)\n q.StderrChan = make(chan []byte, QUEUE_SIZE)\n q.exitChan = make(chan string)\n q.finishChan = make(chan bool)\n\n s, err := aws.NewSqs(qname, taskId)\n q.awsSqs = s\n\n return q, err\n}", "func New(opt *Options) *Queue {\n\tif client == nil {\n\t\tredisOpt := &redis.Options{\n\t\t\tAddr: opt.Connection.Addr,\n\t\t\tPassword: opt.Connection.Password,\n\t\t\tDB: opt.Connection.DB,\n\t\t\tMaxRetries: opt.Connection.MaxRetries,\n\t\t\tDialTimeout: opt.Connection.DialTimeout,\n\t\t\tReadTimeout: opt.Connection.ReadTimeout,\n\t\t\tWriteTimeout: opt.Connection.WriteTimeout,\n\t\t\tPoolSize: opt.Connection.PoolSize,\n\t\t\tPoolTimeout: opt.Connection.PoolTimeout,\n\t\t\tIdleTimeout: opt.Connection.IdleTimeout,\n\t\t}\n\t\tclient = redis.NewClient(redisOpt)\n\t}\n\n\treturn &Queue{\n\t\tjobChannel: make(chan string, 1000),\n\t\tconcurrency: opt.Concurrency,\n\t\tqueueName: opt.QueueName,\n\t\tprocessor: opt.Processor,\n\t\terrorHandler: opt.ErrorHandler,\n\t}\n}", "func New() *Queue {\n\titems := []*item.Item{}\n\tlock := &sync.Mutex{}\n\treturn &Queue{items, lock}\n}", "func NewQueue(ch *amqp.Channel, n string) amqp.Queue {\n\tq, err := ch.QueueDeclare(\n\t\tn,\n\t\tfalse,\n\t\tfalse,\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\tfailOnError(err, \"Failed to declare a queue\")\n\treturn q\n}", "func NewQueueListener(ea *EventAggregator, url string) *QueueListener {\n\n\tql := QueueListener{\n\t\tsources: make(map[string]*dto.Sensor),\n\t\tea: ea,\n\t}\n\n\tql.conn, ql.ch = qutils.GetChannel(url)\n\n\treturn &ql\n}", "func NewManager(ctx context.Context, config *Config) *Manager {\n\tmanager := &Manager{\n\t\tctx: ctx,\n\t\tconfig: config,\n\t\tEntries: map[string]*Entry{},\n\t}\n\tfor _, config := range config.APICalls {\n\t\tapiCall := NewAPICall(config.URI, config.Key)\n\t\tjob := NewFnJob(config.Name, config.Schedule, apiCall.Call)\n\t\tmanager.AddJob(job)\n\t}\n\treturn manager\n}", "func NewQueue() Queue {\r\n\tvar empty []int\r\n\treturn Queue{empty, len(empty)}\r\n}", "func NewQueue() *queue {\n q := new(queue)\n q.head = new(task)\n q.tail = q.head\n\treturn q\n}", "func NewQueue(client *elastic.Client, options ...Option) *Queue {\n\tqueue := &Queue{\n\t\terrorHandler: defaultErrorHandler,\n\t\tcloser: make(chan struct{}),\n\t\ttimeout: time.Second * 5,\n\t}\n\n\tfor _, option := range options {\n\t\toption(queue)\n\t}\n\n\tif queue.requester == nil {\n\t\tqueue.requester = &ClientRequester{Client: client, Timeout: queue.timeout}\n\t}\n\n\tif len(queue.conditions) == 0 {\n\t\tpanic(\"mixer/elasticqueue: write conditions were passed, the client will buffer \" +\n\t\t\t\"infinitely! Use WithCondition() to pass one or more options to NewQueue()\")\n\t}\n\n\tgo queue.listenToConditions()\n\n\treturn queue\n}", "func NewQueue() *Queue {\n\treturn &Queue{\n\t\tdata: []*QueueNode{},\n\t}\n}", "func NewQueue() *Queue {\n\tq := new(Queue)\n\tq.ready = make(ReadyHeap, 0)\n\theap.Init(&q.ready)\n\tq.delay = make(DelayHeap, 0)\n\theap.Init(&q.delay)\n\tq.reserve = NewReserve(new(Item), false)\n\tq.list = make(map[string]bool)\n\tgo q.watchReady()\n\tgo q.watchDelay()\n\treturn q\n}", "func NewQueue() *SubmitQueue {\n\treturn &SubmitQueue{\n\t\tsorted: false,\n\t\titems: nil,\n\t}\n}", "func NewBasicMockMessageQueue() lanternmq.MessageQueue {\n\tmq := BasicMockMessageQueue{}\n\tmq.Queue = make(chan []byte, 20)\n\n\tmq.ConnectFn = func(username string, password string, host string, port string) error {\n\t\treturn nil\n\t}\n\n\tmq.CreateChannelFn = func() (lanternmq.ChannelID, error) {\n\t\treturn 1, nil\n\t}\n\n\tmq.NumConcurrentMsgsFn = func(chID lanternmq.ChannelID, num int) error {\n\t\treturn nil\n\t}\n\n\tmq.QueueExistsFn = func(chId lanternmq.ChannelID, qName string) (bool, error) {\n\t\treturn true, nil\n\t}\n\n\tmq.DeclareQueueFn = func(chID lanternmq.ChannelID, name string) error {\n\t\treturn nil\n\t}\n\n\tmq.PublishToQueueFn = func(chID lanternmq.ChannelID, qName string, message string) error {\n\t\tif len(mq.Queue) < 20 {\n\t\t\tmq.Queue <- []byte(message)\n\t\t} else {\n\t\t\treturn errors.New(\"queue full - unable to add new message\")\n\t\t}\n\t\treturn nil\n\t}\n\n\tmq.ConsumeFromQueueFn = func(chID lanternmq.ChannelID, qName string) (lanternmq.Messages, error) {\n\t\treturn nil, nil\n\t}\n\n\tmq.ProcessMessagesFn = func(ctx context.Context, msgs lanternmq.Messages, handler lanternmq.MessageHandler, args *map[string]interface{}, errs chan<- error) {\n\t\tfor msg := range mq.Queue {\n\t\t\terr := handler(msg, args)\n\t\t\tif err != nil {\n\t\t\t\terrs <- err\n\t\t\t}\n\t\t}\n\t}\n\n\tmq.CloseFn = func() {}\n\treturn &mq\n}", "func New() *JobManager {\n\tjm := JobManager{\n\t\theartbeatInterval: DefaultHeartbeatInterval,\n\t\tjobs: map[string]*JobMeta{},\n\t\ttasks: map[string]*TaskMeta{},\n\t}\n\tjm.schedulerWorker = async.NewInterval(jm.runDueJobs, DefaultHeartbeatInterval)\n\tjm.killHangingTasksWorker = async.NewInterval(jm.killHangingTasks, DefaultHeartbeatInterval)\n\treturn &jm\n}", "func New() *Queue {\r\n\treturn &Queue{\r\n\t\tdata: []int{},\r\n\t}\r\n}", "func NewQueue() Queue{\n\treturn Queue{values: make([]*unsafe.Pointer,50), end: 0,}\n}", "func NewManager(endPoint, slug, shConnStr, fetcherBackendVersion, enricherBackendVersion string, fetch bool, enrich bool, eSUrl string, esUser string, esPassword string, esIndex string, fromDate *time.Time, project string, fetchSize int, enrichSize int, affBaseURL, esCacheURL, esCacheUsername, esCachePassword, authGrantType, authClientID, authClientSecret, authAudience, auth0URL, env, webHookURL string) (*Manager, error) {\n\tmng := &Manager{\n\t\tEndpoint: endPoint,\n\t\tSlug: slug,\n\t\tSHConnString: shConnStr,\n\t\tFetcherBackendVersion: fetcherBackendVersion,\n\t\tEnricherBackendVersion: enricherBackendVersion,\n\t\tFetch: fetch,\n\t\tEnrich: enrich,\n\t\tESUrl: eSUrl,\n\t\tESUsername: esUser,\n\t\tESPassword: esPassword,\n\t\tESIndex: esIndex,\n\t\tFromDate: fromDate,\n\t\tHTTPTimeout: 60 * time.Second,\n\t\tProject: project,\n\t\tFetchSize: fetchSize,\n\t\tEnrichSize: enrichSize,\n\t\tAffBaseURL: affBaseURL,\n\t\tESCacheURL: esCacheURL,\n\t\tESCacheUsername: esCacheUsername,\n\t\tESCachePassword: esCachePassword,\n\t\tAuthGrantType: authGrantType,\n\t\tAuthClientID: authClientID,\n\t\tAuthClientSecret: authClientSecret,\n\t\tAuthAudience: authAudience,\n\t\tAuth0URL: auth0URL,\n\t\tEnvironment: env,\n\t\tesClientProvider: nil,\n\t\tfetcher: nil,\n\t\tenricher: nil,\n\t\tWebHookURL: webHookURL,\n\t\tMaxWorkers: 1000,\n\t}\n\n\tfetcher, enricher, esClientProvider, err := buildServices(mng)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgroupName, err := getGroupName(endPoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmng.fetcher = fetcher\n\tmng.enricher = enricher\n\tmng.esClientProvider = esClientProvider\n\tmng.GroupName = groupName\n\tmng.workerPool = &workerPool{\n\t\tMaxWorker: MaxConcurrentRequests,\n\t\tqueuedTaskC: make(chan func()),\n\t}\n\n\treturn mng, nil\n}", "func NewLLQueue(data interface{}) *LLQueue {\n\tthis := &LLQueue{\n\t\tHead: linkedlist.NewNode(data),\n\t}\n\tthis.Tail = this.Head\n\treturn this\n}", "func NewQueue() *Queue {\n\treturn &Queue{\n\t\titems: []Lit{},\n\t}\n}", "func LocalQueueFactory(size int) Option {\n\treturn func(env Environment) {\n\t\tif size < 5 {\n\t\t\tsize = 5\n\t\t}\n\t\tQueueFactory(makeLocalEventQueueFactory(size))\n\t}\n}", "func (q *QueueMethod) Setup() error {\n\tif err := q.declareExchange(q.Provider.AMQP.DeadLetterExchange, \"direct\", nil); err != nil {\n\t\treturn fmt.Errorf(\"declare exchange failed: name: %s, type: %s, message: %v\", q.Provider.AMQP.DeadLetterExchange, \"direct\", err)\n\t}\n\tif err := q.declareExchange(q.Provider.AMQP.ShardingQueueExchange, \"x-modulus-hash\", nil); err != nil {\n\t\treturn fmt.Errorf(\"declare exchange failed: name: %s, type: %s, message: %v\", q.Provider.AMQP.ShardingQueueExchange, \"x-modulus-hash\", err)\n\t}\n\tif err := q.declareExchange(q.Provider.AMQP.DelayMessageExchange, \"x-delayed-message\", amqp.Table{\"x-delayed-type\": \"x-modulus-hash\"}); err != nil {\n\t\treturn fmt.Errorf(\"declare exchange failed: name: %s, type: %s, message: %v\", q.Provider.AMQP.DelayMessageExchange, \"x-delayed-message\", err)\n\t}\n\tif err := q.bindExchange(q.Provider.AMQP.DelayMessageExchange, q.Provider.AMQP.ShardingQueueExchange, \"\"); err != nil {\n\t\treturn fmt.Errorf(\"bind exchange failed: name: %s to %s, message: %v\", q.Provider.AMQP.DelayMessageExchange, q.Provider.AMQP.ShardingQueueExchange, err)\n\t}\n\n\tif err := q.createPolicy(RabbitMQHaMode, \"\", \"queues\", Definition{\n\t\tHaMode: \"exactly\",\n\t\tHaParam: 2,\n\t\tHaSyncMode: \"automatic\",\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"create policy failed: mode: %s, message: %v\", RabbitMQHaMode, err)\n\t}\n\n\tif err := q.createPolicy(RabbitMQShardMode, \"^sns.sharding$\", \"exchanges\", Definition{\n\t\tShardsPerNode: 2,\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"create policy failed: mode: %s, message: %v\", RabbitMQShardMode, err)\n\t}\n\n\treturn nil\n}", "func New(maxSize int, dropBehavior DropBehavior) *Queue {\n\treturn &Queue{\n\t\tmaxSize: maxSize,\n\t\tdropBehavior: dropBehavior,\n\t}\n}", "func NewMockQueueManager(ctrl *gomock.Controller) *MockQueueManager {\n\tmock := &MockQueueManager{ctrl: ctrl}\n\tmock.recorder = &MockQueueManagerMockRecorder{mock}\n\treturn mock\n}", "func NewQueue() *Queue {\n\tstorageListener := storage.NewListener()\n\tw := window.New(storageListener, 1, time.Microsecond)\n\tgo w.Exec()\n\treturn &Queue{\n\t\tdata: map[int][]byte{},\n\t\tfront: -1,\n\t\tback: 0,\n\t\tstorageW: window.New(storageListener, 64, 500*time.Nanosecond),\n\t}\n}", "func New(dir string) (*Queue, error) {\n\tentries, err := readKeys(dir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar current int\n\tif len(entries) > 0 {\n\t\tcurrent = entries[len(entries)-1]\n\t}\n\treturn &Queue{\n\t\tdir: dir,\n\t\tentries: entries,\n\t\tcurrent: current,\n\t}, nil\n}", "func (r *yandexMessageQueueReconciler) SetupWithManager(mgr ctrl.Manager) error {\n\treturn ctrl.NewControllerManagedBy(mgr).\n\t\tFor(&connectorsv1.YandexMessageQueue{}).\n\t\tComplete(r)\n}", "func newManager(id int, wg *sync.WaitGroup, pr int64, cr float64, ps float64) *Manager {\n\tvar weather Weather\n\tweather.initializeWeather()\n\tweather.generateWeather()\n\tforecast, multiplier := weather.getWeather()\n\tfmt.Printf(\"\\nCURRENT FORECAST: %s\\n\", forecast)\n\n\tproductsRate = pr\n\tcustomerRate = cr * multiplier\n\tprocessSpeed = ps\n\n\tcustomerStatusChan = make(chan int, 256)\n\tcheckoutChangeStatusChan = make(chan int, 256)\n\n\t// Default to 1 Checkout when the store opens\n\tnumberOfCheckoutsOpen = 1\n\n\treturn &Manager{id: id, wg: wg}\n}", "func NewQueue() *Queue {\n\treturn &Queue{\n\t\telements: list.New(),\n\t}\n}", "func NewQueue() *Queue {\n\treturn &Queue{\n\t\telements: list.New(),\n\t}\n}", "func (t *OpenconfigQos_Qos_Interfaces_Interface_Output_Queues) NewQueue(Name string) (*OpenconfigQos_Qos_Interfaces_Interface_Output_Queues_Queue, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Queue == nil {\n\t\tt.Queue = make(map[string]*OpenconfigQos_Qos_Interfaces_Interface_Output_Queues_Queue)\n\t}\n\n\tkey := Name\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Queue[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Queue\", key)\n\t}\n\n\tt.Queue[key] = &OpenconfigQos_Qos_Interfaces_Interface_Output_Queues_Queue{\n\t\tName: &Name,\n\t}\n\n\treturn t.Queue[key], nil\n}", "func New() *Queue {\n\treturn &Queue{\n\t\tidleCh: make(chan interface{}),\n\t\tclosed: false,\n\t}\n}", "func newQuotasManager() Manager {\n\treturn &quotasManager{}\n}", "func (q *queueImp) Create(queue string) error {\n\t// 1. check queue name valid\n\tif utils.BlankString(queue) {\n\t\treturn errors.NotValidf(\"CreateQueue queue:%s\", queue)\n\t}\n\n\t// 2. check kafka whether the queue exists\n\texist, err := q.manager.ExistTopic(queue, true)\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tif exist {\n\t\treturn errors.AlreadyExistsf(\"CreateQueue queue:%s \", queue)\n\t}\n\n\t// 3. check metadata whether the queue exists\n\texist, err = q.extendManager.ExistQueue(queue)\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\tif exist {\n\t\treturn errors.AlreadyExistsf(\"CreateQueue queue:%s \", queue)\n\t}\n\t// 4. create kafka topic\n\tif err = q.manager.CreateTopic(queue, q.conf.KafkaReplications,\n\t\tq.conf.KafkaPartitions, q.conf.KafkaZKAddr); err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\t// 5. add metadata of queue\n\tif err = q.extendManager.AddQueue(queue); err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\treturn nil\n}", "func NewQueue(dirPath string, dataSizeLimit int64) (Queue, error) {\n\tif err := mkDirFunc(dirPath); err != nil {\n\t\treturn nil, err\n\t}\n\tlock := &sync.RWMutex{}\n\tq := &queue{\n\t\tdirPath: dirPath,\n\t\tdataSizeLimit: dataSizeLimit,\n\t\trwMutex: lock,\n\t\tnotEmpty: sync.NewCond(lock),\n\t}\n\n\t// if data size limit < default limit, need reset\n\tif q.dataSizeLimit < defaultDataSizeLimit {\n\t\tq.dataSizeLimit = defaultDataSizeLimit\n\t}\n\n\tvar err error\n\n\tdefer func() {\n\t\t// if init queue failure, need release resource(like file/map file etc.)\n\t\tif err != nil {\n\t\t\tq.Close()\n\t\t}\n\t}()\n\n\t// init data page factory\n\tvar dataPageFct page.Factory\n\tdataPageFct, err = newPageFactoryFunc(filepath.Join(dirPath, dataPath), dataPageSize)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tq.dataPageFct = dataPageFct\n\n\t// init index page factory\n\tvar indexPageFct page.Factory\n\tindexPageFct, err = newPageFactoryFunc(filepath.Join(dirPath, indexPath), indexPageSize)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tq.indexPageFct = indexPageFct\n\n\thasMeta := fileutil.Exist(filepath.Join(dirPath, metaPath, fmt.Sprintf(\"%d.bat\", metaPageIndex)))\n\n\t// init meta page factory\n\tvar metaPageFct page.Factory\n\tmetaPageFct, err = newPageFactoryFunc(filepath.Join(dirPath, metaPath), metaPageSize)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tq.metaPageFct = metaPageFct\n\n\tq.metaPage, err = q.metaPageFct.AcquirePage(metaPageIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif hasMeta {\n\t\t// initialize sequence\n\t\tq.initSequence()\n\t} else {\n\t\tq.appendedSeq.Store(SeqNoNewMessageAvailable)\n\t\tq.acknowledgedSeq.Store(SeqNoNewMessageAvailable)\n\n\t\t// persist metadata\n\t\tq.metaPage.PutUint64(uint64(q.AppendedSeq()), queueAppendedSeqOffset)\n\t\tq.metaPage.PutUint64(uint64(q.AcknowledgedSeq()), queueAcknowledgedSeqOffset)\n\n\t\terr = q.metaPage.Sync()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// initialize data page indexes\n\terr = q.initDataPageIndex()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn q, nil\n}", "func NewRequestManager(ttl time.Duration) *RequestManager {\n\treturn &RequestManager{\n\t\trequests: map[interface{}]*requestQueue{},\n\t\tttl: ttl,\n\t\tnow: metav1.Now,\n\t}\n}", "func NewQueue(url, exchangeName, queueName string) (*Queue, error) {\n\tqueue := Queue{\n\t\turl: url,\n\t\texchangeName: exchangeName,\n\t\tqueueName: queueName,\n\t}\n\terr := queue.Connect()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = queue.Declare()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &queue, nil\n}", "func NewManager(system Resumer, name string, kubeClient kubernetes.Interface) *Manager {\n\treturn &Manager{\n\t\tstop: make(chan struct{}),\n\t\tsystem: system,\n\t\tname: name,\n\t\tkubeClient: kubeClient,\n\t}\n}", "func newQuotasManager() QuotaManager {\n\treturn &quotasManager{}\n}", "func NewQueue(name string) *Queue {\n\tctx, cancel := context.WithCancel(context.Background())\n\treturn &Queue{\n\t\tjobs: make(chan Job),\n\t\tname: name,\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t}\n}", "func NewManager(\n\tlogger logging.LoggerInterface,\n\tsynchronizer synchronizerInterface,\n\tcfg *conf.AdvancedConfig,\n\tfeedbackLoop chan<- int64,\n\tauthAPI service.AuthClient,\n\truntimeTelemetry storage.TelemetryRuntimeProducer,\n\tmetadata dtos.Metadata,\n\tclientKey *string,\n\thcMonitor application.MonitorProducerInterface, // Deprecated: This is no longer used, left here only to avoid a breaking change\n) (*ManagerImpl, error) {\n\n\tprocessor, err := NewProcessor(cfg.SplitUpdateQueueSize, cfg.SegmentUpdateQueueSize, synchronizer, logger)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error instantiating processor: %w\", err)\n\t}\n\n\tstatusTracker := NewStatusTracker(logger, runtimeTelemetry)\n\tparser := &NotificationParserImpl{\n\t\tlogger: logger,\n\t\tonSplitUpdate: processor.ProcessSplitChangeUpdate,\n\t\tonSplitKill: processor.ProcessSplitKillUpdate,\n\t\tonSegmentUpdate: processor.ProcessSegmentChangeUpdate,\n\t\tonControlUpdate: statusTracker.HandleControl,\n\t\tonOccupancyMesage: statusTracker.HandleOccupancy,\n\t\tonAblyError: statusTracker.HandleAblyError,\n\t}\n\n\tmanager := &ManagerImpl{\n\t\tauthAPI: authAPI,\n\t\tsseClient: sse.NewStreamingClient(cfg, logger, metadata, clientKey),\n\t\tstatusTracker: statusTracker,\n\t\tfeedback: feedbackLoop,\n\t\tprocessor: processor,\n\t\tparser: parser,\n\t\tlogger: logger,\n\t\truntimeTelemetry: runtimeTelemetry,\n\t}\n\tmanager.lifecycle.Setup()\n\treturn manager, nil\n}" ]
[ "0.6894487", "0.6460588", "0.6222042", "0.61513555", "0.6091006", "0.606205", "0.60386145", "0.6006943", "0.59639966", "0.594565", "0.5942067", "0.59363455", "0.5910915", "0.5891163", "0.5883823", "0.5868089", "0.5867437", "0.58120775", "0.579116", "0.57845575", "0.5739835", "0.5729333", "0.57284796", "0.5727378", "0.57215804", "0.5712212", "0.57040274", "0.5703663", "0.570017", "0.5695105", "0.5686319", "0.56860936", "0.5670982", "0.5670982", "0.56662583", "0.5644873", "0.5636126", "0.5625117", "0.5620882", "0.5615961", "0.5586366", "0.5586366", "0.5585547", "0.55763906", "0.55730265", "0.5562347", "0.5558622", "0.554701", "0.55468494", "0.5542528", "0.5534157", "0.5519224", "0.54966015", "0.54926205", "0.5488962", "0.5475239", "0.5475239", "0.54693717", "0.5466636", "0.54603916", "0.54525185", "0.5438298", "0.5435606", "0.54334134", "0.5428155", "0.54264826", "0.5426083", "0.5412998", "0.54060096", "0.5405864", "0.5382502", "0.5380629", "0.5378693", "0.5369328", "0.5361096", "0.5356475", "0.5354758", "0.5353707", "0.53503066", "0.5349652", "0.53444856", "0.53388375", "0.53265595", "0.5317479", "0.53142416", "0.5310355", "0.53072613", "0.5302812", "0.5302812", "0.5290566", "0.52859527", "0.5285241", "0.52829885", "0.5282758", "0.52773714", "0.52661717", "0.525159", "0.52441984", "0.5235611", "0.5232728" ]
0.6490378
1
NewQueueManagerWithDefaults instantiates a new QueueManager object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set
func NewQueueManagerWithDefaults() *QueueManager { this := QueueManager{} return &this }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewQueueManager(logger log.Logger, cfg config.QueueConfig, externalLabels labels.Labels, relabelConfigs []*relabel.Config, client StorageClient, flushDeadline time.Duration) *QueueManager {\n\tif logger == nil {\n\t\tlogger = log.NewNopLogger()\n\t} else {\n\t\tlogger = log.With(logger, \"queue\", client.Name())\n\t}\n\tt := &QueueManager{\n\t\tlogger: logger,\n\t\tflushDeadline: flushDeadline,\n\t\tcfg: cfg,\n\t\texternalLabels: externalLabels,\n\t\trelabelConfigs: relabelConfigs,\n\t\tclient: client,\n\t\tqueueName: client.Name(),\n\n\t\tlogLimiter: rate.NewLimiter(logRateLimit, logBurst),\n\t\tnumShards: cfg.MinShards,\n\t\treshardChan: make(chan int),\n\t\tquit: make(chan struct{}),\n\n\t\tsamplesIn: newEWMARate(ewmaWeight, shardUpdateDuration),\n\t\tsamplesOut: newEWMARate(ewmaWeight, shardUpdateDuration),\n\t\tsamplesOutDuration: newEWMARate(ewmaWeight, shardUpdateDuration),\n\t}\n\tt.shards = t.newShards(t.numShards)\n\tnumShards.WithLabelValues(t.queueName).Set(float64(t.numShards))\n\tshardCapacity.WithLabelValues(t.queueName).Set(float64(t.cfg.Capacity))\n\n\t// Initialize counter labels to zero.\n\tsentBatchDuration.WithLabelValues(t.queueName)\n\tsucceededSamplesTotal.WithLabelValues(t.queueName)\n\tfailedSamplesTotal.WithLabelValues(t.queueName)\n\tdroppedSamplesTotal.WithLabelValues(t.queueName)\n\n\treturn t\n}", "func NewDefaultClient() QueueClient {\n\treturn &inMemoryQueue{queues: make(map[string][]string)}\n}", "func DefaultQueue(queue string) func(*Locker) error {\n\treturn func(l *Locker) error {\n\t\tl.DefaultQueue = queue\n\t\treturn nil\n\t}\n}", "func (m ManagedConsumerConfig) setDefaults() ManagedConsumerConfig {\n\tif m.NewConsumerTimeout <= 0 {\n\t\tm.NewConsumerTimeout = 5 * time.Second\n\t}\n\tif m.InitialReconnectDelay <= 0 {\n\t\tm.InitialReconnectDelay = 1 * time.Second\n\t}\n\tif m.MaxReconnectDelay <= 0 {\n\t\tm.MaxReconnectDelay = 5 * time.Minute\n\t}\n\t// unbuffered queue not allowed\n\tif m.QueueSize <= 0 {\n\t\tm.QueueSize = 128\n\t}\n\n\treturn m\n}", "func Default() *JobManager {\n\tif _default == nil {\n\t\t_defaultLock.Lock()\n\t\tdefer _defaultLock.Unlock()\n\n\t\tif _default == nil {\n\t\t\t_default = New()\n\t\t}\n\t}\n\treturn _default\n}", "func NewDefault(db *bolt.DB) (q queue.WaitQueue, err error) {\n\treturn New(db, DefaultBucket, DefaultMemQueueSize, DefaultBufSize)\n}", "func DefaultQueue(queue string) func(*Config) error {\n\treturn func(c *Config) error {\n\t\tc.DefaultQueue = queue\n\t\treturn nil\n\t}\n}", "func (obj *RabbitQueue) Default() {\n\trabbitQueueLog.Info(\"default\", \"name\", obj.Name, \"namespace\", obj.Namespace)\n\n\tif obj.Spec.QueueName == \"\" {\n\t\tobj.Spec.QueueName = obj.Name\n\t}\n}", "func NewQueueManager(name string, clusters []string, aliasQueues []AliasQueue, remoteQueues []RemoteQueue, clusterQueues []ClusterQueue, ) *QueueManager {\n\tthis := QueueManager{}\n\tthis.Name = name\n\tthis.Clusters = clusters\n\tthis.AliasQueues = aliasQueues\n\tthis.RemoteQueues = remoteQueues\n\tthis.ClusterQueues = clusterQueues\n\treturn &this\n}", "func DefaultQueueSettings() QueueSettings {\n\treturn QueueSettings{\n\t\tEnabled: true,\n\t\tNumConsumers: 10,\n\t\t// For 5000 queue elements at 100 requests/sec gives about 50 sec of survival of destination outage.\n\t\t// This is a pretty decent value for production.\n\t\t// User should calculate this from the perspective of how many seconds to buffer in case of a backend outage,\n\t\t// multiply that by the number of requests per seconds.\n\t\tQueueSize: 5000,\n\t\tPersistentStorageEnabled: false,\n\t}\n}", "func NewQueueManager(q amboy.Queue) Manager {\n\treturn &queueManager{\n\t\tqueue: q,\n\t}\n}", "func NewDefault(m map[string]interface{}) (share.Manager, error) {\n\tc := &config{}\n\tif err := mapstructure.Decode(m, c); err != nil {\n\t\terr = errors.Wrap(err, \"error creating a new manager\")\n\t\treturn nil, err\n\t}\n\n\ts, err := metadata.NewCS3Storage(c.GatewayAddr, c.ProviderAddr, c.ServiceUserID, c.ServiceUserIdp, c.MachineAuthAPIKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tindexer := indexer.CreateIndexer(s)\n\n\tclient, err := pool.GetGatewayServiceClient(c.GatewayAddr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn New(client, s, indexer)\n}", "func NewQueue(maxQueueSize, maxFlowSize uint64, helper Interface) *Queue {\n\tif maxFlowSize > maxQueueSize {\n\t\tpanic(\"MaxFlowSize > MaxQueueSize\")\n\t}\n\n\tif helper == nil {\n\t\tpanic(\"helper is nil\")\n\t}\n\n\tq := new(Queue)\n\tq.cond.L = &q.lock\n\tq.maxQueueSize = maxQueueSize\n\tq.maxFlowSize = maxFlowSize\n\tq.helper = helper\n\tq.flows = make(map[uint64]*flowInfo)\n\n\treturn q\n}", "func New(mqURL string) (models.MessageQueue, error) {\n\tmq, err := newmq(mqURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &metricMQ{mq}, nil\n}", "func NewDefaultMQService() *mqServiceImpl {\n\treturn &mqServiceImpl{}\n}", "func New() *queue {\n\treturn &queue{\n\t\titems: make([]item, DefaultCapacity),\n\t\tcapacity: DefaultCapacity,\n\t}\n}", "func newDefaultPodManager() *podManager {\n\treturn &podManager{\n\t\trunningPods: make(map[string]*runningPod),\n\t\trequests: make(chan *cniserver.PodRequest, 20),\n\t\treattachPods: make(map[string]*corev1.Pod),\n\t}\n}", "func NewDefaultManager() *Manager {\n\tm := NewManager()\n\n\t// default config\n\tm.SetAuthorizeCodeExp(time.Minute * 10)\n\tm.SetImplicitTokenCfg(&Config{AccessTokenExp: time.Hour * 1})\n\tm.SetClientTokenCfg(&Config{AccessTokenExp: time.Hour * 2})\n\tm.SetAuthorizeCodeTokenCfg(&Config{IsGenerateRefresh: true, AccessTokenExp: time.Hour * 2, RefreshTokenExp: time.Hour * 24 * 3})\n\tm.SetPasswordTokenCfg(&Config{IsGenerateRefresh: true, AccessTokenExp: time.Hour * 2, RefreshTokenExp: time.Hour * 24 * 7})\n\n\tm.MapTokenModel(models.NewToken())\n\tm.MapAuthorizeGenerate(generates.NewAuthorizeGenerate())\n\tm.MapAccessGenerate(generates.NewAccessGenerate())\n\n\treturn m\n}", "func NewQueue(maximumCapacity int, initialCapacity int, factory TokenFactory) *Queue {\n\tq := &Queue{\n\t\tmaxCapacity: maximumCapacity,\n\t\tavailableTokens: make(chan (Token), maximumCapacity),\n\t\tcommittedTokens: make(chan (Token), maximumCapacity),\n\t\tdiscardTokens: make(chan (Token), maximumCapacity),\n\t\tcloseTokens: make(chan (Token)),\n\t}\n\n\tfor i := 0; i < maximumCapacity; i++ {\n\t\ttoken := factory()\n\t\tif token == nil {\n\t\t\treturn nil\n\t\t}\n\t\tq.discardTokens <- token\n\t\tq.validTokens = append(q.validTokens, token)\n\t}\n\n\tq.EnableDisableTokens(initialCapacity)\n\n\treturn q\n}", "func NewBasicMockMessageQueue() lanternmq.MessageQueue {\n\tmq := BasicMockMessageQueue{}\n\tmq.Queue = make(chan []byte, 20)\n\n\tmq.ConnectFn = func(username string, password string, host string, port string) error {\n\t\treturn nil\n\t}\n\n\tmq.CreateChannelFn = func() (lanternmq.ChannelID, error) {\n\t\treturn 1, nil\n\t}\n\n\tmq.NumConcurrentMsgsFn = func(chID lanternmq.ChannelID, num int) error {\n\t\treturn nil\n\t}\n\n\tmq.QueueExistsFn = func(chId lanternmq.ChannelID, qName string) (bool, error) {\n\t\treturn true, nil\n\t}\n\n\tmq.DeclareQueueFn = func(chID lanternmq.ChannelID, name string) error {\n\t\treturn nil\n\t}\n\n\tmq.PublishToQueueFn = func(chID lanternmq.ChannelID, qName string, message string) error {\n\t\tif len(mq.Queue) < 20 {\n\t\t\tmq.Queue <- []byte(message)\n\t\t} else {\n\t\t\treturn errors.New(\"queue full - unable to add new message\")\n\t\t}\n\t\treturn nil\n\t}\n\n\tmq.ConsumeFromQueueFn = func(chID lanternmq.ChannelID, qName string) (lanternmq.Messages, error) {\n\t\treturn nil, nil\n\t}\n\n\tmq.ProcessMessagesFn = func(ctx context.Context, msgs lanternmq.Messages, handler lanternmq.MessageHandler, args *map[string]interface{}, errs chan<- error) {\n\t\tfor msg := range mq.Queue {\n\t\t\terr := handler(msg, args)\n\t\t\tif err != nil {\n\t\t\t\terrs <- err\n\t\t\t}\n\t\t}\n\t}\n\n\tmq.CloseFn = func() {}\n\treturn &mq\n}", "func New() *Queue {\r\n\treturn &Queue{nil,nil,0}\r\n}", "func New(mqURL string) (models.MessageQueue, error) {\n\t// Play with URL schemes here: https://play.golang.org/p/xWAf9SpCBW\n\tu, err := url.Parse(mqURL)\n\tif err != nil {\n\t\tlogrus.WithError(err).WithFields(logrus.Fields{\"url\": mqURL}).Fatal(\"bad MQ URL\")\n\t}\n\tlogrus.WithFields(logrus.Fields{\"mq\": u.Scheme}).Debug(\"selecting MQ\")\n\tswitch u.Scheme {\n\tcase \"memory\":\n\t\treturn NewMemoryMQ(), nil\n\tcase \"redis\":\n\t\treturn NewRedisMQ(u)\n\tcase \"bolt\":\n\t\treturn NewBoltMQ(u)\n\t}\n\tif strings.HasPrefix(u.Scheme, \"ironmq\") {\n\t\treturn NewIronMQ(u), nil\n\t}\n\n\treturn nil, fmt.Errorf(\"mq type not supported %v\", u.Scheme)\n}", "func NewQueue() *Queue {\n return &Queue{member: make([]interface{}, 0)}\n}", "func New() Manager {\n\treturn Manager{\n\t\tState: make(map[string]string),\n\t\tClientHolder: make(map[string]utils.Set),\n\t\tClientQueue: make(map[string]utils.Queue),\n\t}\n}", "func NewManager(logger logging.Logger) SessionManager {\n\treturn &defaultSessionManager{\n\t\tlogger: logger,\n\t\ttasks: make(map[string]exec.Execer),\n\n\t\tquit: make(chan struct{}),\n\t}\n}", "func (queue *Queue) Init() (err error) {\n\tclient := queue.GetClient()\n\n\tparams := &sqs.CreateQueueInput{\n\t\tQueueName: aws.String(queue.Name + deadLetterQueueSuffix),\n\t\tAttributes: map[string]*string{\n\t\t\t\"MessageRetentionPeriod\": aws.String(\"1209600\"),\n\t\t},\n\t}\n\tresp, err := client.CreateQueue(params)\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"queueName\": queue.Name,\n\t\t\t\"error\": err,\n\t\t}).Error(\"Createing the dead letter queue\")\n\t\treturn\n\t}\n\n\tqueue.DeadLetterQueueURL = *resp.QueueUrl\n\tlog.WithFields(log.Fields{\n\t\t\"QueueUrl\": queue.DeadLetterQueueURL,\n\t}).Info(\"Dead Letter Queue initialized\")\n\n\tqueueArnAttributeName := \"QueueArn\"\n\tdeadLetterQueueAttributes, err := queue.GetAttributesByQueueURL(queue.DeadLetterQueueURL, []*string{&queueArnAttributeName})\n\tif err != nil {\n\t\treturn\n\t}\n\tredrivePolicy := &RedrivePolicy{\n\t\tMaxReceiveCount: MaxReceiveCountBeforeDead,\n\t\tDeadLetterTargetArn: *deadLetterQueueAttributes.Attributes[queueArnAttributeName],\n\t}\n\tredrivePolicyString, err := redrivePolicy.GetAsAWSString()\n\tif err != nil {\n\t\treturn\n\t}\n\tparams = &sqs.CreateQueueInput{\n\t\tQueueName: aws.String(queue.Name),\n\t\tAttributes: map[string]*string{\n\t\t\t\"RedrivePolicy\": redrivePolicyString,\n\t\t\t\"MessageRetentionPeriod\": aws.String(\"1209600\"),\n\t\t},\n\t}\n\tresp, err = client.CreateQueue(params)\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"queueName\": queue.Name,\n\t\t\t\"error\": err,\n\t\t}).Error(\"Createing the queue\")\n\t\treturn\n\t}\n\n\tqueue.URL = *resp.QueueUrl\n\tlog.WithFields(log.Fields{\n\t\t\"QueueUrl\": queue.URL,\n\t}).Info(\"Queue initialized\")\n\n\treturn\n}", "func New() *Queue {\n\treturn &Queue{nil, nil, 0}\n}", "func New() *Queue {\n\treturn &Queue{nil, nil, 0}\n}", "func MyQueueConstructor() MyQueue {\n\treturn MyQueue{}\n}", "func New() *JobManager {\n\tjm := JobManager{\n\t\theartbeatInterval: DefaultHeartbeatInterval,\n\t\tjobs: map[string]*JobMeta{},\n\t\ttasks: map[string]*TaskMeta{},\n\t}\n\tjm.schedulerWorker = async.NewInterval(jm.runDueJobs, DefaultHeartbeatInterval)\n\tjm.killHangingTasksWorker = async.NewInterval(jm.killHangingTasks, DefaultHeartbeatInterval)\n\treturn &jm\n}", "func WithDefaultMaxTries(n int) Option {\n\treturn func(q *Queue) {\n\t\tq.maxTries = n\n\t}\n}", "func NewDefaultRestrictionManager(maxValueLength int) *DefaultRestrictionManager {\n\tif maxValueLength == 0 {\n\t\tmaxValueLength = defaultMaxValueLength\n\t}\n\treturn &DefaultRestrictionManager{\n\t\tdefaultRestriction: &Restriction{keyAllowed: true, maxValueLength: maxValueLength},\n\t}\n}", "func (manager *Manager) SetDefaults() {\n\tmanager.viperConfig.SetDefault(workspace, \"No name\")\n\n\tmanager.viperConfig.SetDefault(tcpAddress, \"localhost:8888\")\n\tmanager.viperConfig.SetDefault(tcpConnectionType, \"tcp\")\n\n\tmanager.viperConfig.SetDefault(httpAddress, \":8080\")\n\n\tmanager.viperConfig.SetDefault(shutdownTimeout, 15*time.Second)\n\tmanager.viperConfig.SetDefault(readTimeout, 10*time.Second)\n\tmanager.viperConfig.SetDefault(writeTimeout, 10*time.Second)\n\n\tmanager.viperConfig.SetDefault(websocketReadBufferSize, 1024)\n\tmanager.viperConfig.SetDefault(websocketWriteBufferSize, 1024)\n\tmanager.viperConfig.SetDefault(websocketMaxMessageSize, 512)\n\tmanager.viperConfig.SetDefault(websocketWriteWait, 10*time.Second)\n\tmanager.viperConfig.SetDefault(websocketPongWait, 60*time.Second)\n\tmanager.viperConfig.SetDefault(websocketPingPeriod, 60*0.9*time.Second)\n\n\tmanager.viperConfig.SetDefault(httpTimeout, 1*time.Second)\n\n\tmanager.viperConfig.SetDefault(logLevel, \"debug\")\n}", "func NewQueue() Queue {\n\treturn Queue{}\n}", "func NewQueue(name string) *Queue {\n\tredisClient := GetRedisClientFromConfig()\n\tqueue := &Queue{Name: name, RedisClient: redisClient}\n\treturn queue\n}", "func NewQueue(name string, itemType reflect.Type, maxQueueSize uint32) Queue {\n\tq := queue{\n\t\tname: name,\n\t\titemType: itemType,\n\t\tchannel: make(chan interface{}, maxQueueSize),\n\t}\n\treturn &q\n}", "func setupManager(username string, password string, brokerIp string, brokerPort int, manager *Manager, exchange string, queueName string) error {\n\tamqpURI := getAmqpUri(username, password, brokerIp, brokerPort)\n\tmanager.logger.Debugf(\"dialing %s\", amqpURI)\n\tvar err error\n\tmanager.Connection, err = amqp.Dial(amqpURI)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanager.logger.Debugf(\"got Connection, getting Channel\")\n\tmanager.Channel, err = manager.Connection.Channel()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanager.logger.Debugf(\"got Channel, declaring Exchange (%q)\", exchange)\n\n\tmanager.logger.Debugf(\"declared Exchange, declaring Queue %q\", queueName)\n\tqueue, err := manager.Channel.QueueDeclare(\n\t\tqueueName,\n\t\ttrue,\n\t\ttrue,\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanager.logger.Debugf(\"declared Queue (%q, %d messages, %d consumers), binding to Exchange\",\n\t\tqueue.Name, queue.Messages, queue.Consumers)\n\n\tif err = manager.Channel.QueueBind(\n\t\tqueue.Name, // name of the queue\n\t\tqueue.Name, // bindingKey\n\t\texchange, // sourceExchange\n\t\tfalse, // noWait\n\t\tnil, // arguments\n\t); err != nil {\n\t\treturn err\n\t}\n\n\tmanager.logger.Debug(\"Queue bound to Exchange, starting Consume\")\n\treturn nil\n}", "func NewQueue(maxWorkers int, maxQueue int) *Queue {\n\tq := make(chan Job, maxQueue)\n\treturn &Queue{\n\t\tq,\n\t\ttrue,\n\t\t&Dispatcher{\n\t\t\tjobQueue: q,\n\t\t\tworkerPool: make(chan chan Job, maxWorkers),\n\t\t\tMaxWorkers: maxWorkers,\n\t\t},\n\t}\n}", "func LocalQueueFactory(size int) Option {\n\treturn func(env Environment) {\n\t\tif size < 5 {\n\t\t\tsize = 5\n\t\t}\n\t\tQueueFactory(makeLocalEventQueueFactory(size))\n\t}\n}", "func NewFakeQueueDispatcher() (dispatcher *FakeQueueDispatcher) {\n\tdispatcher = &FakeQueueDispatcher{}\n\tdispatcher.Messages = make([]interface{}, 0)\n\treturn\n}", "func setupDefaults() {\n\tclient.DefaultClient = grpcCli.NewClient()\n\tserver.DefaultServer = grpcSvr.NewServer()\n\tnetwork.DefaultNetwork = mucpNet.NewNetwork()\n\tmetrics.DefaultMetricsReporter = noopMet.New()\n\n\t// setup rpc implementations after the client is configured\n\tauth.DefaultAuth = authSrv.NewAuth()\n\tbroker.DefaultBroker = brokerSrv.NewBroker()\n\tevents.DefaultStream = eventsSrv.NewStream()\n\tevents.DefaultStore = eventsSrv.NewStore()\n\tregistry.DefaultRegistry = registrySrv.NewRegistry()\n\trouter.DefaultRouter = routerSrv.NewRouter()\n\tstore.DefaultStore = storeSrv.NewStore()\n\tstore.DefaultBlobStore = storeSrv.NewBlobStore()\n\truntime.DefaultRuntime = runtimeSrv.NewRuntime()\n}", "func SetDefault(jm *JobManager) {\n\t_defaultLock.Lock()\n\t_default = jm\n\t_defaultLock.Unlock()\n}", "func NewDefaultPriorityQueue() *PriorityQueue {\n\treturn NewPriorityQueue(func(interface{}) bool { return false })\n}", "func NewManager(h Handler,\n\tusername string,\n\tpassword string,\n\tbrokerIp string,\n\tbrokerPort int,\n\texchange string,\n\tqueueName string,\n\tworkers int,\n\tallocate bool,\n\tmanagerName string,\n\thandleFunction handlerFunction,\n\tlogLevel string,\n\tnet catalogue.BaseNetworkInt,\n\timg catalogue.BaseImageInt) (*Manager, error) {\n\n\tmanager := &Manager{\n\t\tConnection: nil,\n\t\tChannel: nil,\n\t\tallocate: allocate,\n\t\tworkers: workers,\n\t\terrorChan: make(chan error),\n\t\tlogger: GetLogger(managerName, logLevel),\n\t\thandlerFunction: handleFunction,\n\t\thandler: h,\n\t\timage: img,\n\t\tnetwork: net,\n\t}\n\n\terr := setupManager(username, password, brokerIp, brokerPort, manager, exchange, queueName)\n\tif err != nil {\n\t\tmanager.logger.Errorf(\"Error while setup the amqp thing: %v\", err)\n\t\treturn nil, err\n\t}\n\tmanager.queueName = queueName\n\treturn manager, nil\n}", "func NewQueue(ctx context.Context, queueID string, db *sql.DB, conf QueueConfig) (*Queue, error) {\n\tq := &Queue{ID: queueID}\n\tq.repo = repo.NewRepository(db)\n\tq.PollRate = 100 * time.Millisecond // Default\n\tq.queueSize = 10000 // Default\n\tq.retries = 3 // Default\n\tq.IsMultiQueue = conf.IsMultiQueue\n\tq.baseDelay = 3 * time.Second // Default\n\n\tif conf.PollingRate > 0 {\n\t\tq.PollRate = conf.PollingRate\n\t}\n\tif conf.Qsize > 0 {\n\t\tq.queueSize = conf.Qsize\n\t}\n\tif conf.BaseDelay > 0 {\n\t\tq.baseDelay = conf.BaseDelay\n\t}\n\tif conf.Retries >= 0 {\n\t\tq.retries = conf.Retries\n\t}\n\t// Multilevel Queue/channel created\n\ttemp := mlQueue{}\n\ttemp.notifier = make([]chan JobChan, 1)\n\ttemp.notifier[0] = make(chan JobChan, q.queueSize)\n\ttemp.total = 1\n\tq.mq = temp\n\n\tm := make(map[string][]worker.Worker)\n\tq.workers = m\n\tvar wg sync.WaitGroup\n\tq.wg = &wg\n\n\t// resume stopped jobs\n\terr := q.ResumePendingJobs(ctx)\n\tif err != nil {\n\t\tlogger.Log.Error(\"Unable to resume jobs from bucket: %s\", zap.Error(err))\n\t\t// Don't fail out, this isn't really fatal. But maybe it should be?\n\t}\n\treturn q, nil\n}", "func New(name string, c config.Config) *Queue {\n\treturn &Queue{\n\t\tname: name,\n\t\tconf: c,\n\t}\n}", "func New() Queue {\n\treturn Queue{list: linkedlist.New()}\n}", "func NewDefaultManager(\n\tdemands *cache.SafeDemandCache,\n\tbinpacker *binpacker.Binpacker,\n\tinstanceGroupLabel string) Manager {\n\treturn &defaultManager{\n\t\tdemands: demands,\n\t\tbinpacker: binpacker,\n\t\tinstanceGroupLabel: instanceGroupLabel,\n\t}\n}", "func NewQueue(action WorkAction, options ...QueueOption) *Queue {\n\tq := Queue{\n\t\tLatch: NewLatch(),\n\t\tAction: action,\n\t\tContext: context.Background(),\n\t\tMaxWork: DefaultQueueMaxWork,\n\t\tParallelism: runtime.NumCPU(),\n\t}\n\tfor _, option := range options {\n\t\toption(&q)\n\t}\n\treturn &q\n}", "func NewDefaults() map[string]interface{} {\n\tdefaults := make(map[string]interface{})\n\n\tdefaults[authPostgresURI] = \"postgresql://postgres:postgres@localhost:5432/test?sslmode=disable\"\n\tdefaults[authMigrationVersion] = 0\n\n\tdefaults[gatewayAddr] = \":10000\"\n\tdefaults[gatewayEndpoint] = \"/graphql\"\n\tdefaults[gatewayServePlayground] = true\n\tdefaults[gatewayPlaygroundEndpoint] = \"/playground\"\n\tdefaults[gatewayEnableIntrospection] = true\n\n\tdefaults[seedUserLogin] = \"root\"\n\tdefaults[seedUserPassword] = \"root\"\n\tdefaults[seedRoleTitle] = \"ROOT\"\n\tdefaults[seedRoleSuper] = true\n\n\tdefaults[sessionAccessTokenTTL] = 1000000\n\tdefaults[sessionRefreshTokenTTl] = 5000000\n\n\treturn defaults\n}", "func New(opt *Options) *Queue {\n\tif client == nil {\n\t\tredisOpt := &redis.Options{\n\t\t\tAddr: opt.Connection.Addr,\n\t\t\tPassword: opt.Connection.Password,\n\t\t\tDB: opt.Connection.DB,\n\t\t\tMaxRetries: opt.Connection.MaxRetries,\n\t\t\tDialTimeout: opt.Connection.DialTimeout,\n\t\t\tReadTimeout: opt.Connection.ReadTimeout,\n\t\t\tWriteTimeout: opt.Connection.WriteTimeout,\n\t\t\tPoolSize: opt.Connection.PoolSize,\n\t\t\tPoolTimeout: opt.Connection.PoolTimeout,\n\t\t\tIdleTimeout: opt.Connection.IdleTimeout,\n\t\t}\n\t\tclient = redis.NewClient(redisOpt)\n\t}\n\n\treturn &Queue{\n\t\tjobChannel: make(chan string, 1000),\n\t\tconcurrency: opt.Concurrency,\n\t\tqueueName: opt.QueueName,\n\t\tprocessor: opt.Processor,\n\t\terrorHandler: opt.ErrorHandler,\n\t}\n}", "func (o *SendJobCommandParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func New() *Queue {\n\tq := new(Queue)\n\tq.length = 0\n\tq.s1 = stack.New()\n\tq.s2 = stack.New()\n\n\treturn q\n}", "func NewQueue() *Queue {\n\treturn &Queue{nil, nil, 0}\n}", "func defaultConsumerOptions() *consumerOptions {\n\treturn &consumerOptions{\n\t\tqueueDepth: 10000,\n\t\tconcurrency: 10,\n\t\tStats: &NilConsumerStatsCollector{},\n\t}\n}", "func NewQueue(action func(interface{}) error) *QueueWorker {\n\treturn &QueueWorker{\n\t\taction: action,\n\t\tlatch: &Latch{},\n\t\tmaxWork: DefaultQueueWorkerMaxWork,\n\t}\n}", "func (o *GetGPUArchitectureParams) SetDefaults() {\n\tvar (\n\t\tallowUnstableDefault = bool(false)\n\t)\n\n\tval := GetGPUArchitectureParams{\n\t\tAllowUnstable: &allowUnstableDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func NewQueue(l int) *Queue {\n\tif l == -1 {\n\t\treturn &Queue{\n\t\t\tQueue: make([]types.Event, 0),\n\t\t\tL: int(^uint(0) >> 1), // max integer value, architecture independent\n\t\t}\n\t}\n\tq := &Queue{\n\t\tQueue: make([]types.Event, 0, l),\n\t\tL: l,\n\t}\n\tlog.WithFields(log.Fields{\"Capacity\": q.L}).Debugf(\"Creating queue\")\n\treturn q\n}", "func NewDefaults() *Client {\n\treturn &Client{\n\t\tsigkil: make(chan os.Signal, 1),\n\t\tsighup: make(chan os.Signal, 1),\n\t\tmenu: make(map[string]ui.MenuItem),\n\t\tplex: &logs.Timer{},\n\t\talert: &logs.Cooler{},\n\t\tLogger: logs.New(),\n\t\tConfig: &configfile.Config{\n\t\t\tApps: &apps.Apps{\n\t\t\t\tURLBase: \"/\",\n\t\t\t},\n\t\t\tServices: &services.Config{\n\t\t\t\tInterval: cnfg.Duration{Duration: services.DefaultSendInterval},\n\t\t\t\tParallel: 1,\n\t\t\t},\n\t\t\tBindAddr: configfile.DefaultBindAddr,\n\t\t\tSnapshot: &snapshot.Config{\n\t\t\t\tTimeout: cnfg.Duration{Duration: snapshot.DefaultTimeout},\n\t\t\t},\n\t\t\tLogs: &logs.Logs{\n\t\t\t\tLogFiles: DefaultLogFiles,\n\t\t\t\tLogFileMb: DefaultLogFileMb,\n\t\t\t},\n\t\t\tTimeout: cnfg.Duration{Duration: configfile.DefaultTimeout},\n\t\t}, Flags: &Flags{\n\t\t\tFlagSet: flag.NewFlagSet(DefaultName, flag.ExitOnError),\n\t\t\tConfigFile: os.Getenv(DefaultEnvPrefix + \"_CONFIG_FILE\"),\n\t\t\tEnvPrefix: DefaultEnvPrefix,\n\t\t},\n\t}\n}", "func New(hint int) *Queue {\n\treturn &Queue{\n\t\titems: make([]interface{}, 0, hint),\n\t}\n}", "func initMailQueueProducer() (err error) {\n\tnsqCfg := nsq.NewConfig()\n\tnsqCfg.UserAgent = \"tmail.queue\"\n\tNsqQueueProducer, err = nsq.NewProducer(\"127.0.0.1:4150\", nsqCfg)\n\tif Cfg.GetDebugEnabled() {\n\t\tNsqQueueProducer.SetLogger(Log, 0)\n\t} else {\n\t\tNsqQueueProducer.SetLogger(Log, 4)\n\t}\n\treturn err\n}", "func New(name string) (*Queue, error) {\n\tqueue := Queue{Name: name}\n\terr := queue.Init()\n\n\treturn &queue, err\n}", "func New(maxSize int, dropBehavior DropBehavior) *Queue {\n\treturn &Queue{\n\t\tmaxSize: maxSize,\n\t\tdropBehavior: dropBehavior,\n\t}\n}", "func New(delegate Delegate, settings Settings) (*Queue, error) {\n\tconst op = \"pq/new\"\n\n\tif delegate == nil {\n\t\treturn nil, errOp(op).of(InvalidParam).report(\"delegate must not be nil\")\n\t}\n\n\taccessor, errKind := makeAccess(delegate)\n\tif errKind != NoError {\n\t\treturn nil, errOp(op).of(errKind)\n\t}\n\n\tpageSize := delegate.PageSize()\n\n\tq := &Queue{\n\t\taccessor: accessor,\n\t\tsettings: settings,\n\t\tpagePool: newPagePool(pageSize),\n\t}\n\n\t// use pointer address as ID for correlating error messages\n\tq.id = queueID(uintptr(unsafe.Pointer(q)))\n\taccessor.quID = q.id\n\n\trootBuf, err := q.accessor.ReadRoot()\n\tif err != nil {\n\t\treturn nil, wrapErr(op, err).of(InitFailed).\n\t\t\treport(\"failed to read queue header\")\n\t}\n\n\troot := castQueueRootPage(rootBuf[:])\n\tif root.version.Get() != queueVersion {\n\t\tcause := &Error{\n\t\t\tkind: InitFailed,\n\t\t\tmsg: fmt.Sprintf(\"queue version %v\", root.version.Get()),\n\t\t}\n\t\treturn nil, wrapErr(op, cause).of(InitFailed)\n\t}\n\n\ttracef(\"open queue: %p (pageSize: %v)\\n\", q, pageSize)\n\ttraceQueueHeader(root)\n\n\tq.version = root.version.Get()\n\tq.hdrOffset = q.accessor.RootFileOffset()\n\tq.onInit()\n\treturn q, nil\n}", "func NewPrinterDefaults()(*PrinterDefaults) {\n m := &PrinterDefaults{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "func (r *yandexMessageQueueReconciler) SetupWithManager(mgr ctrl.Manager) error {\n\treturn ctrl.NewControllerManagedBy(mgr).\n\t\tFor(&connectorsv1.YandexMessageQueue{}).\n\t\tComplete(r)\n}", "func (o *RTRCheckAdminCommandStatusParams) SetDefaults() {\n\tvar (\n\t\tsequenceIDDefault = int64(0)\n\t)\n\n\tval := RTRCheckAdminCommandStatusParams{\n\t\tSequenceID: sequenceIDDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func New(cfg Config, pubSub pubSub, metrics metricsProvider) (*Queue, error) {\n\tmsgChan, err := pubSub.SubscribeWithOpts(context.Background(), topic, spi.WithPool(cfg.PoolSize))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"subscribe to topic [%s]: %w\", topic, err)\n\t}\n\n\tq := &Queue{\n\t\tpubSub: pubSub,\n\t\tmsgChan: msgChan,\n\t\tjsonMarshal: json.Marshal,\n\t\tjsonUnmarshal: json.Unmarshal,\n\t\tmetrics: metrics,\n\t}\n\n\tq.Lifecycle = lifecycle.New(\"operation-queue\",\n\t\tlifecycle.WithStart(q.start),\n\t\tlifecycle.WithStop(q.stop),\n\t)\n\n\tq.Start()\n\n\treturn q, nil\n}", "func NewQueue() Queue {\r\n\tvar empty []int\r\n\treturn Queue{empty, len(empty)}\r\n}", "func New() *Queue {\n\titems := []*item.Item{}\n\tlock := &sync.Mutex{}\n\treturn &Queue{items, lock}\n}", "func NewQueue(\n\tservers []string,\n\topts QueueOptions,\n) (Queue, error) {\n\tq, err := newQueue(servers, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tq.initConnections(servers)\n\tgo q.reportMetrics()\n\n\treturn q, nil\n}", "func NewQueue(storage Storage, reQueueTimeout time.Duration) Queue {\n\tif reQueueTimeout < 1 {\n\t\treQueueTimeout = time.Minute * 30\n\t}\n\n\tname := \"gocelery\"\n\tq := &queue{\n\t\tstorage: storage,\n\t\thead: 0,\n\t\ttail: 0,\n\t\trequeueTimeout: reQueueTimeout,\n\t\tqueuePrefix: fmt.Sprintf(\"%s-queue-\", name),\n\t\tqueueAckPrefix: fmt.Sprintf(\"%s-ack-\", name),\n\t}\n\n\t// restore the old state from the DB\n\tq.loadHeadTail()\n\treturn q\n}", "func (s *Store) CreateQueue(name string, overriddenSettings ...QueueSetting) (QueueMeta, QueueSettings, error) {\n\tif !isValidQueueName(name) {\n\t\treturn QueueMeta{}, QueueSettings{}, ErrInvalidQueueName\n\t}\n\n\tmeta := QueueMeta{Name: name, Created: time.Now()}\n\tsettings := defaultQueueSettings()\n\n\tfor _, setting := range overriddenSettings {\n\t\tif err := setting(&settings); err != nil {\n\t\t\treturn QueueMeta{}, QueueSettings{}, err\n\t\t}\n\t}\n\n\treturn meta, settings, s.db.Update(func(tx *bolt.Tx) error {\n\t\tqueues := tx.Bucket([]byte(\"Queues\"))\n\n\t\tbucket, err := queues.CreateBucket([]byte(name))\n\t\tif err != nil {\n\t\t\tif err == bolt.ErrBucketExists {\n\t\t\t\treturn ErrQueueExists\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\t// Meta\n\n\t\tmetaBucket, err := bucket.CreateBucketIfNotExists([]byte(\"Meta\"))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err = metaBucket.Put([]byte(\"Name\"), []byte(name)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err = metaBucket.Put([]byte(\"Created\"), encodeTime(meta.Created)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Settings\n\n\t\tsettingsBucket, err := bucket.CreateBucketIfNotExists([]byte(\"Settings\"))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err = settingsBucket.Put([]byte(\"LeaseDuration\"), encodeInt(settings.LeaseDuration)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = settingsBucket.Put([]byte(\"MessageRetentionPeriod\"), encodeInt(settings.MessageRetentionPeriod)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = settingsBucket.Put([]byte(\"DelaySeconds\"), encodeInt(settings.DelaySeconds)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Message Buckets\n\n\t\tmessages, err := bucket.CreateBucketIfNotExists([]byte(\"Messages\"))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif _, err := messages.CreateBucketIfNotExists([]byte(\"Visible\")); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif _, err := messages.CreateBucketIfNotExists([]byte(\"Leased\")); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif _, err := messages.CreateBucketIfNotExists([]byte(\"Delayed\")); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t})\n}", "func DefaultQueueKeysFunc(_ runtime.Object) []string {\n\treturn []string{DefaultQueueKey}\n}", "func New(cfg config.Queue, n notifier) *Queue {\n\tq := &Queue{\n\t\taddCh: make(chan struct{}, cfg.QueueSize),\n\t\tpopCh: make(chan struct{}, cfg.GoRoutinesSize),\n\t\taddMessage: make(chan entity.NotifierMessage, 1),\n\t\tpopMessage: make(chan entity.NotifierMessage, 1),\n\t\tnotifier: n,\n\t}\n\n\tgo q.pop()\n\tgo q.add()\n\n\treturn q\n}", "func New(cb Done, transport http.RoundTripper) *Manager {\n\treturn &Manager{\n\t\tkeys: sets.NewString(),\n\t\tcb: cb,\n\t\ttransport: transport,\n\t}\n}", "func newDefaultContainerConfig() ContainerConfig {\n\treturn ContainerConfig{\n\t\tCPU: newMinMaxAllocation(),\n\t\tMemory: newMinMaxAllocation(),\n\t\tBlockRead: newMinMaxAllocation(),\n\t\tBlockWrite: newMinMaxAllocation(),\n\t\tNetworkRx: newMinMaxAllocation(),\n\t\tNetworkTx: newMinMaxAllocation(),\n\t}\n}", "func NewQueue(ctx *pulumi.Context,\n\tname string, args *QueueArgs, opts ...pulumi.ResourceOption) (*Queue, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.HoursOfOperationArn == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'HoursOfOperationArn'\")\n\t}\n\tif args.InstanceArn == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'InstanceArn'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Queue\n\terr := ctx.RegisterResource(\"aws-native:connect:Queue\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "func (o *ListHetznerSizesParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func (t *OpenconfigQos_Qos_Queues) NewQueue(Name string) (*OpenconfigQos_Qos_Queues_Queue, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Queue == nil {\n\t\tt.Queue = make(map[string]*OpenconfigQos_Qos_Queues_Queue)\n\t}\n\n\tkey := Name\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Queue[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Queue\", key)\n\t}\n\n\tt.Queue[key] = &OpenconfigQos_Qos_Queues_Queue{\n\t\tName: &Name,\n\t}\n\n\treturn t.Queue[key], nil\n}", "func GetDefaultManager() *Manager {\n\treturn defaultManager\n}", "func (o *GetFqdnCacheParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewAPIRequestManager() *APIRequestManager {\n\treturn &APIRequestManager{\n\t\tqueue: make(chan *WorkerItem, 10),\n\t}\n}", "func New() *Queue {\r\n\treturn &Queue{\r\n\t\tdata: []int{},\r\n\t}\r\n}", "func setDefault(c *Config) {\n\tc.Token = \"\"\n\tc.GuildID = \"\"\n}", "func New(ctx context.Context, cfg models.Config) (*Queue, error) {\n\tconn, err := connect(ctx, cfg)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to connect to RabbitMQ \")\n\t}\n\n\tch, err := conn.Channel()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to open a channel \")\n\t}\n\n\t_, err = ch.QueueDeclare(\"ItemQueue\", false, false, false, false, nil)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to declare a queue \")\n\t}\n\n\treturn &Queue{ch, conn}, nil\n}", "func (c *InitManagementClusterInput) Defaults(ctx context.Context) {\n\tc.Config.Defaults()\n\tif c.Scheme == nil {\n\t\tc.Scheme = runtime.NewScheme()\n\t}\n\tif c.NewManagementClusterFn == nil {\n\t\tc.NewManagementClusterFn = func() (ManagementCluster, error) {\n\t\t\treturn kind.NewCluster(ctx, c.ManagementClusterName, c.Scheme)\n\t\t}\n\t}\n}", "func (c *InitManagementClusterInput) Defaults(ctx context.Context) {\n\tc.Config.Defaults()\n\tif c.Scheme == nil {\n\t\tc.Scheme = runtime.NewScheme()\n\t}\n\tif c.NewManagementClusterFn == nil {\n\t\tc.NewManagementClusterFn = func() (ManagementCluster, error) {\n\t\t\treturn kind.NewCluster(ctx, c.ManagementClusterName, c.Scheme)\n\t\t}\n\t}\n}", "func NewSmsTrackingWithDefaults() *SmsTracking {\n\tthis := SmsTracking{}\n\treturn &this\n}", "func (cc *ConstructionCreate) defaults() {\n\tif _, ok := cc.mutation.RawProduction(); !ok {\n\t\tv := construction.DefaultRawProduction\n\t\tcc.mutation.SetRawProduction(v)\n\t}\n\tif _, ok := cc.mutation.Production(); !ok {\n\t\tv := construction.DefaultProduction\n\t\tcc.mutation.SetProduction(v)\n\t}\n\tif _, ok := cc.mutation.GetType(); !ok {\n\t\tv := construction.DefaultType\n\t\tcc.mutation.SetType(v)\n\t}\n\tif _, ok := cc.mutation.Level(); !ok {\n\t\tv := construction.DefaultLevel\n\t\tcc.mutation.SetLevel(v)\n\t}\n\tif _, ok := cc.mutation.Modifier(); !ok {\n\t\tv := construction.DefaultModifier\n\t\tcc.mutation.SetModifier(v)\n\t}\n\tif _, ok := cc.mutation.LastUpdated(); !ok {\n\t\tv := construction.DefaultLastUpdated()\n\t\tcc.mutation.SetLastUpdated(v)\n\t}\n\tif _, ok := cc.mutation.NeedRefresh(); !ok {\n\t\tv := construction.DefaultNeedRefresh\n\t\tcc.mutation.SetNeedRefresh(v)\n\t}\n}", "func (t *OpenconfigQos_Qos_Interfaces_Interface_Input_Queues) NewQueue(Name string) (*OpenconfigQos_Qos_Interfaces_Interface_Input_Queues_Queue, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Queue == nil {\n\t\tt.Queue = make(map[string]*OpenconfigQos_Qos_Interfaces_Interface_Input_Queues_Queue)\n\t}\n\n\tkey := Name\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Queue[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Queue\", key)\n\t}\n\n\tt.Queue[key] = &OpenconfigQos_Qos_Interfaces_Interface_Input_Queues_Queue{\n\t\tName: &Name,\n\t}\n\n\treturn t.Queue[key], nil\n}", "func (o *StorageServiceMetricsHintsInProgressGetParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "func NewQueue(args []func(http.ResponseWriter, *http.Request) (http.ResponseWriter, *http.Request)) *Queue {\n\tq := &Queue{}\n\tfor _, f := range args {\n\t\tq.list = append(q.list, f)\n\t}\n\treturn q\n}", "func Constructor() MyQueue {\n\treturn Myqueue{list: listNew()}\n}", "func NewQueue() *Queue {\n\treturn &Queue{}\n}", "func NewQueue() *Queue {\n\treturn &Queue{}\n}", "func (o *GetBundleByKeyParams) SetDefaults() {\n\tvar (\n\t\tauditDefault = string(\"NONE\")\n\n\t\tincludedDeletedDefault = bool(false)\n\t)\n\n\tval := GetBundleByKeyParams{\n\t\tAudit: &auditDefault,\n\t\tIncludedDeleted: &includedDeletedDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func New(\n\tlogger *zap.SugaredLogger,\n\tflushFunc, closeFunc func(),\n\topts Options,\n) *Queue {\n\tif flushFunc == nil {\n\t\tflushFunc = func() {}\n\t}\n\tif closeFunc == nil {\n\t\tcloseFunc = func() {}\n\t}\n\tif opts.Rate == 0 {\n\t\topts.Rate = 5 * time.Second\n\t}\n\n\tvar counter = int32(0)\n\treturn &Queue{\n\t\tl: logger,\n\n\t\tcloseFunc: closeFunc,\n\t\tflushFunc: flushFunc,\n\n\t\tpendingC: make(chan func(), 3*opts.BatchSize),\n\t\tpending: &counter,\n\t\trate: opts.Rate,\n\t\tbatchSize: opts.BatchSize,\n\n\t\tstopC: make(chan bool, 1),\n\t\tstopped: false,\n\t}\n}", "func (o *QtreeCollectionGetParams) SetDefaults() {\n\tvar (\n\t\treturnRecordsDefault = bool(true)\n\n\t\treturnTimeoutDefault = int64(15)\n\t)\n\n\tval := QtreeCollectionGetParams{\n\t\tReturnRecords: &returnRecordsDefault,\n\t\tReturnTimeout: &returnTimeoutDefault,\n\t}\n\n\tval.timeout = o.timeout\n\tval.Context = o.Context\n\tval.HTTPClient = o.HTTPClient\n\t*o = val\n}", "func newQueue() *Queue {\n\tl := list.New()\n\treturn &Queue{Elements: l}\n}" ]
[ "0.6368561", "0.5929313", "0.5928396", "0.59103316", "0.5819523", "0.58130354", "0.5753316", "0.5739753", "0.568538", "0.5661701", "0.5606484", "0.5487868", "0.54643965", "0.5463153", "0.54630005", "0.5449085", "0.544472", "0.54301214", "0.540289", "0.5370558", "0.535047", "0.5341004", "0.5334277", "0.5295785", "0.52576846", "0.52551335", "0.52515256", "0.52515256", "0.52440447", "0.5240541", "0.52186775", "0.52153325", "0.5206354", "0.51808494", "0.5172658", "0.5166101", "0.5157915", "0.5146065", "0.5141454", "0.5139676", "0.5139047", "0.51379216", "0.51322454", "0.5129915", "0.5124572", "0.51156694", "0.5109505", "0.5105227", "0.5103686", "0.51033306", "0.5093908", "0.50899905", "0.5077126", "0.50655735", "0.5062785", "0.5044816", "0.50357693", "0.50288504", "0.5013021", "0.50087065", "0.50034255", "0.49959683", "0.49950668", "0.49800548", "0.4976274", "0.49653354", "0.49580646", "0.49579832", "0.49559307", "0.49503115", "0.49397472", "0.4929721", "0.49250063", "0.4920364", "0.49179143", "0.49174854", "0.49174672", "0.49137354", "0.4901583", "0.48928303", "0.48868117", "0.4878816", "0.48771858", "0.48752692", "0.48736435", "0.48721433", "0.48712355", "0.48712355", "0.48708367", "0.48632345", "0.4862766", "0.48562503", "0.4856162", "0.48510158", "0.4849206", "0.4849206", "0.48466817", "0.48451757", "0.48441622", "0.48435262" ]
0.7690877
0
GetName returns the Name field value
func (o *QueueManager) GetName() string { if o == nil { var ret string return ret } return o.Name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *SingleSelectFieldField) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (f *Field) GetName() string {\n\treturn formatGoName(f.Name)\n}", "func (e *Entry) GetName() string {\n\tif len(e.NameRaw) > 0 {\n\t\treturn string(e.NameRaw)\n\t}\n\treturn e.Name\n}", "func (o *FormField) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (p *GetField) Name() string { return p.name }", "func (f BinaryField) GetName() string {\n\treturn f.name\n}", "func (s *RecordSchema) GetName() string {\n\treturn s.Name\n}", "func (o *ContentProviderReadDetailed) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (t *Type) GetName() string {\n\treturn formatGoName(t.Name)\n}", "func (m *metadata) GetName() string {\n\treturn m.name\n}", "func (f *Fieldx) Name() string {\n\treturn f.data.Name\n}", "func (d UserData) Name() string {\n\tval := d.ModelData.Get(models.NewFieldName(\"Name\", \"name\"))\n\tif !d.Has(models.NewFieldName(\"Name\", \"name\")) {\n\t\treturn *new(string)\n\t}\n\treturn val.(string)\n}", "func (o *SiteMapReadDetailed) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (o FieldOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v Field) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "func (l *Label) GetName() string {\n\tif l == nil || l.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Name\n}", "func (cli *SetWrapper) GetName() (string, error) {\n\tvals, err := cli.set.GetValues()\n\tif nil != err {\n\t\treturn \"\", err\n\t}\n\treturn vals.String(fieldSetName), nil\n}", "func (f *Field) Name() string {\n\treturn f.field.Name\n}", "func (o *AddOn) GetName() (value string, ok bool) {\n\tok = o != nil && o.bitmap_&2048 != 0\n\tif ok {\n\t\tvalue = o.name\n\t}\n\treturn\n}", "func (o *CreateInstance) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (o *DisplayInfo) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (o *Credit1099Payer) GetName() string {\n\tif o == nil || o.Name.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name.Get()\n}", "func (meta *Metadata) GetName() string {\n\treturn meta.Name\n}", "func (m *Metadata) GetName() string {\n\treturn m.Name\n}", "func (inst *InstUIToFP) GetName() string {\n\treturn inst.Name\n}", "func (f BooleanField) GetName() string {\n\treturn f.name\n}", "func (n Normalizer) GetName() string {\n\treturn n.name\n}", "func (inst *InstFPToUI) GetName() string {\n\treturn inst.Name\n}", "func (t *Type) GetName() string { return t.Name }", "func (s *StickerSet) GetName() (value string) {\n\tif s == nil {\n\t\treturn\n\t}\n\treturn s.Name\n}", "func (f *DialectMessageField) GetName() string {\n\treturn f.name\n}", "func (o *FifoCreateReqWeb) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (o *Content) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (o *Ga4ghChemotherapy) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (request *DomainRegisterRequest) GetName() *string {\n\treturn request.GetStringProperty(\"Name\")\n}", "func (o *StorageSasExpander) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (t *NamedType) GetName() string {\n\treturn t.Name\n}", "func (o *Tag) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (x DashboardEntity) GetName() string {\n\treturn x.Name\n}", "func (o *GovChainMetadata) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (o *EventsScalarQuery) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (inst *InstFPExt) GetName() string {\n\treturn inst.Name\n}", "func (o *CredentialsResponseElement) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (ds *Datasource) GetName() string {\n\treturn ds.name\n}", "func (b *Base) GetName() string {\n\treturn b.Name\n}", "func (b *Base) GetName() string {\n\treturn b.Name\n}", "func (m *Metric) GetName() string {\n\tif m == nil || m.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Name\n}", "func (r Source) GetName() string {\n\treturn r.Name\n}", "func (o *Member) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (l *LabelResult) GetName() string {\n\tif l == nil || l.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Name\n}", "func (o *Metric) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (o *GridViewUpdate) GetName() string {\n\tif o == nil || IsNil(o.Name) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (x GenericEntity) GetName() string {\n\treturn x.Name\n}", "func (inst *InstFPToSI) GetName() string {\n\treturn inst.Name\n}", "func (x ExternalEntity) GetName() string {\n\treturn x.Name\n}", "func (b *Being) GetName() string {\n\treturn b.Name.Display\n}", "func (o *BaseItem) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (inst *InstTrunc) GetName() string {\n\treturn inst.Name\n}", "func (c FieldsCollection) Name() *models.Field {\n\treturn c.MustGet(\"Name\")\n}", "func (m *Resource) GetName() string {\n\tif m != nil {\n\t\treturn m.Name\n\t}\n\treturn \"\"\n}", "func (c *Definition) GetName() string {\n\treturn c.Name\n}", "func (o *ResourceEntry) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (ct *ComposedTemplate) GetName() string {\n\tif ct.Name != nil {\n\t\treturn *ct.Name\n\t}\n\treturn \"\"\n}", "func (field Field) Name() string {\n\tif len(field.Names) > 0 {\n\t\treturn field.Names[0].String()\n\t}\n\n\t// The field has no name, so we use Type name as the field name.\n\treturn itemTypeName(field.TypeValue.Type).Name\n}", "func (inst *InstFPTrunc) GetName() string {\n\treturn inst.Name\n}", "func (o *LocalDatabaseProvider) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (t *SentryTaggedStruct) GetName() string {\n\treturn \"\"\n}", "func (o *RelatedAssetSerializerWithPermission) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (inst *InstBitCast) GetName() string {\n\treturn inst.Name\n}", "func (p *Plan) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}", "func (i *Identity) GetName() string {\n\treturn i.Name\n}", "func (o *Ga4ghTumourboard) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (entry *Entry) GetName() (name ndn.Name) {\n\tc := (*CEntry)(entry)\n\tname.UnmarshalBinary(c.NameV[:c.NameL])\n\treturn name\n}", "func (o *LogsPipelineProcessor) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (x ApmDatabaseInstanceEntity) GetName() string {\n\treturn x.Name\n}", "func (o *EventTypeIn) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (p *Person) GetName() string {\n\treturn p.name\n}", "func (o *SecurityMonitoringRuleCase) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (obj *ObjectBase) GetName() string {\n\treturn obj.name\n}", "func (s *FixedSchema) GetName() string {\n\treturn s.Name\n}", "func (o *LogicalDatabaseResponse) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (s *StructField) Name() string {\n\treturn s.name\n}", "func (o *EquipmentBaseSensor) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (s *Source) GetName() string {\n\treturn s.Name\n}", "func (o *EmbeddedUnitModel) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (o *ComponentReferenceDTO) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (o *CreateTemplateRequestEntity) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "func (o *Replication) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (c *STableField) Name() string {\n\tif len(c.alias) > 0 {\n\t\treturn c.alias\n\t}\n\treturn c.spec.Name()\n}", "func (o *Site3) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (e *EnumEntry) GetName() string { return e.Name }", "func (o *LimitRate) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (inst *InstSExt) GetName() string {\n\treturn inst.Name\n}", "func (x WorkloadEntity) GetName() string {\n\treturn x.Name\n}", "func (v *TypeReference) GetName() (o string) {\n\tif v != nil {\n\t\to = v.Name\n\t}\n\treturn\n}", "func (n Node) GetName() string {\n\treturn n.Name\n}", "func (s *RecursiveSchema) GetName() string {\n\treturn s.Actual.GetName()\n}", "func (o *Account) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (inst *InstSIToFP) GetName() string {\n\treturn inst.Name\n}", "func (o *View) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (o *RoleWithAccess) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "func (obj *BlobAttribute) GetName() string {\n\treturn obj.getName()\n}" ]
[ "0.8270152", "0.79907626", "0.7765679", "0.76368356", "0.7604266", "0.7600852", "0.75710016", "0.7564642", "0.7548394", "0.75191027", "0.7517443", "0.7511258", "0.7505484", "0.74717504", "0.7460151", "0.7448915", "0.7438394", "0.7437716", "0.7437274", "0.74279296", "0.74176025", "0.7417425", "0.73988014", "0.7398225", "0.73829347", "0.73791754", "0.7377273", "0.73704046", "0.73656774", "0.7355937", "0.7354654", "0.7351853", "0.73467225", "0.7343459", "0.7326997", "0.73269904", "0.73185426", "0.73109293", "0.7305797", "0.7305369", "0.7301732", "0.7299439", "0.72957164", "0.7289352", "0.7289352", "0.7284731", "0.7284502", "0.72793746", "0.7276065", "0.7272541", "0.72633016", "0.7261334", "0.7261052", "0.72606975", "0.7257407", "0.72564834", "0.72544855", "0.7248087", "0.7244419", "0.7244409", "0.72382206", "0.7232118", "0.7232057", "0.7215937", "0.7212889", "0.72091377", "0.7207112", "0.7204379", "0.720419", "0.72028446", "0.7201746", "0.71989995", "0.7198318", "0.71961045", "0.7195568", "0.7193702", "0.719241", "0.7187218", "0.7186939", "0.7183314", "0.71782213", "0.71694314", "0.7166108", "0.7165342", "0.716414", "0.7163785", "0.7163008", "0.71605873", "0.7160267", "0.71582985", "0.7156023", "0.71534425", "0.7149648", "0.71479595", "0.71464264", "0.7144716", "0.71443707", "0.7144208", "0.7140781", "0.71401983", "0.7139454" ]
0.0
-1
GetNameOk returns a tuple with the Name field value and a boolean to check if the value has been set.
func (o *QueueManager) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *SingleSelectFieldField) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *FormField) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Credit1099Payer) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name.Get(), o.Name.IsSet()\n}", "func (o *CreateInstance) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *Ga4ghChemotherapy) GetNameOk() (string, bool) {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Name, true\n}", "func (o *SharedSecretSet3) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *SharedSecretSetCreate) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *Member) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ConnectorTypeAllOf) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ConnectorTypeAllOf) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *User) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *EditBankConnectionParams) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *VersionedConnection) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *EnvironmentVariablePair1) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *ApiKey) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ParameterContextDTO) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Name) GetNameOk() (int32, bool) {\n\tif o == nil || o.Name == nil {\n\t\tvar ret int32\n\t\treturn ret, false\n\t}\n\treturn *o.Name, true\n}", "func (o *Tag) GetNameOk() (string, bool) {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Name, true\n}", "func (o *WafPolicyGroup) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Ga4ghTumourboard) GetNameOk() (string, bool) {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Name, true\n}", "func (o *GeoipConfig2) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *GovChainMetadata) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *CredentialsResponseElement) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *GridViewUpdate) GetNameOk() (*string, bool) {\n\tif o == nil || IsNil(o.Name) {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *LocalDatabaseProvider) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *CloudInstanceTypeAllOf) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *EventsScalarQuery) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Ga4ghFeature) GetNameOk() (string, bool) {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Name, true\n}", "func (o *UpdateRole) GetNameOk() (string, bool) {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Name, true\n}", "func (o *Commitstatus) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *IamServiceProviderAllOf) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ProjectApiKey) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *LogicalDatabaseResponse) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *EquipmentBaseSensor) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Replication) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *UiNodeInputAttributes) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *Account) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *FileversionFileversion) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *WorkflowWorkflowDefinitionAllOf) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *SecurityMonitoringRuleCase) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *EventTypeIn) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *RoleWithAccess) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *V0037JobProperties) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *DisplayInfo) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *ComponentReferenceDTO) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Platform) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *FifoCreateReqWeb) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *BackupUnitProperties) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\n\treturn o.Name, true\n}", "func (o *SyntheticMonitorUpdate) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *ResourceProperties) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\n\treturn o.Name, true\n}", "func (o *Vm) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *ContentProvider2) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *LogsPipelineProcessor) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *BaseItem) GetNameOk() (string, bool) {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Name, true\n}", "func (o *ViewSampleProject) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *IdentityAccount) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *EmbeddedUnitModel) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *OutputProblemAllOf) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *WorkflowServiceItemDefinitionAllOf) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Site3) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *RackUnitPersonality) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *View) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *Workloadv1Location) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ResourceEntry) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *KubernetesAddonDefinitionAllOf) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Transaction) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *Channel) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *Content) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *Project) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *EtherPhysicalPort) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ContentProviderReadDetailed) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *WorkflowBuildTaskMeta) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *TokenCard) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *CreateProjectApiKeyRequest) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *MicrosoftGraphVerifiedDomain) GetNameOk() (string, bool) {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Name, true\n}", "func (o *ManualDependency) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ViewTag) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *RelatedAssetSerializerWithPermission) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *IamUserAuthorization) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *FlowBreadcrumbDTO) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *CreateEventPayloadActions) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *SyntheticsBrowserTest) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *UpdateServerCertificateRequest) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *IamProjectRoleCreate) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *ModelsBackupJobStatusResponse) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ApplicationLoadBalancerForwardingRuleProperties) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\n\treturn o.Name, true\n}", "func (o *SiteMapReadDetailed) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *V0037Node) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *HyperflexHealthCheckPackageChecksum) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ViewMilestone) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *OnpremUpgradePhase) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Product) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *ShowSystem) GetNameOk() (*string, bool) {\n\tif o == nil || IsNil(o.Name) {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *Metric) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *PluginMount) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *MonitorSearchResult) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *IncidentTeamResponseAttributes) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *HttpDelivery) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Name, true\n}", "func (o *VersionedControllerService) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *CreateTemplateRequestEntity) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}", "func (o *StorageSasExpander) GetNameOk() (*string, bool) {\n\tif o == nil || o.Name == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name, true\n}" ]
[ "0.78737646", "0.7743277", "0.76780003", "0.76587296", "0.7625746", "0.7576448", "0.7566445", "0.754901", "0.7547995", "0.7547995", "0.7546563", "0.7531728", "0.74989444", "0.7477683", "0.7444606", "0.74311113", "0.74224156", "0.7415727", "0.73950857", "0.73914826", "0.7377958", "0.73696923", "0.7369173", "0.73578656", "0.7353992", "0.7343812", "0.7337855", "0.7334837", "0.73294985", "0.7326691", "0.7326075", "0.73203164", "0.7310711", "0.7306018", "0.7303261", "0.73022515", "0.7293332", "0.7260063", "0.72574806", "0.72475743", "0.72444725", "0.72408175", "0.7237908", "0.7235848", "0.72357357", "0.7235004", "0.7234653", "0.7234264", "0.7230227", "0.7228573", "0.7224436", "0.721976", "0.72129697", "0.72088903", "0.7207785", "0.7206651", "0.72049356", "0.7202382", "0.71983904", "0.7194746", "0.71889794", "0.7187908", "0.7187718", "0.7185701", "0.7182476", "0.7172748", "0.71694", "0.7165475", "0.71627665", "0.71518505", "0.7151123", "0.7149924", "0.71391815", "0.71388054", "0.7131289", "0.71307176", "0.71282786", "0.71266574", "0.71239126", "0.7123541", "0.71223587", "0.71211797", "0.7120866", "0.7118214", "0.711135", "0.71099347", "0.710965", "0.71078134", "0.71058035", "0.71012187", "0.71009016", "0.70980823", "0.70923406", "0.709159", "0.70859045", "0.70719177", "0.7071204", "0.7065237", "0.7059648", "0.7056911", "0.7049086" ]
0.0
-1
SetName sets field value
func (o *QueueManager) SetName(v string) { o.Name = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cli *SetWrapper) SetName(name string) error {\n\treturn cli.set.SetValue(fieldSetName, name)\n}", "func (m *ModelStructRecord) SetField(name string, value reflect.Value) {\n\tif name == \"\" {\n\t\treturn\n\t}\n\tfieldValue := m.FieldValues[name]\n\t//if value.Kind() == reflect.Ptr {\n\t//\tpanic(\"RecordFieldSetError: value cannot be a ptr\")\n\t//}\n\tif fieldValue.IsValid() == false {\n\t\tm.VirtualFieldValues[name] = reflect.New(m.model.GetFieldWithName(name).StructField().Type).Elem()\n\t\tfieldValue = m.VirtualFieldValues[name]\n\t}\n\t//fieldValue = LoopIndirectAndNew(fieldValue)\n\tsafeSet(fieldValue, value)\n}", "func (me *TdtypeType) Set(s string) { (*xsdt.Nmtoken)(me).Set(s) }", "func (o *Wfmagent) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (o *Createshareresponse) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (s *Structx) Set(name string, value interface{}) error {\n\tf, ok := s.Field(name)\n\tif !ok {\n\t\treturn ErrNotField\n\t}\n\n\treturn f.Set(value)\n}", "func (r *Wrapper) Set(name string, val any) error {\n\tfv := r.rv.FieldByName(name)\n\tif !fv.IsValid() {\n\t\treturn errors.New(\"field not found\")\n\t}\n\n\tif !fv.CanSet() {\n\t\treturn errors.New(\"field can not set value\")\n\t}\n\n\tfv.Set(reflect.ValueOf(val))\n\treturn nil\n}", "func Set(target, source interface{}) error {\n\tconverter := &Converter{\n\t\tTagName: \"field\",\n\t}\n\n\treturn converter.Convert(source, target)\n}", "func (f *Flow) setName(n string) {\n\tf.Name = n\n}", "func (o *Workitemwrapup) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (o *Actionmap) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (df *DataFrame) SetField(name string, val starlark.Value) error {\n\tif df.frozen {\n\t\treturn fmt.Errorf(\"cannot set, DataFrame is frozen\")\n\t}\n\n\tif name == \"columns\" {\n\t\tidx, ok := val.(*Index)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"cannot assign to 'columns', wrong type\")\n\t\t}\n\t\tdf.columns = idx\n\t\treturn nil\n\t}\n\treturn starlark.NoSuchAttrError(name)\n}", "func (me *TactionType) Set(s string) { (*xsdt.Nmtoken)(me).Set(s) }", "func (me *TSAFTPTPaymentType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func SetStrByName(o interface{}, name string, val string) {\n\tif fd := reflect.ValueOf(o).Elem().FieldByName(name); fd.IsValid() {\n\t\tfd.SetString(val)\n\t}\n}", "func (me *TxsdType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TxsdType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func setterName(typeName string) string {\n\treturn fmt.Sprintf(\"Set%s\", accessorName(typeName))\n}", "func (me *TClipValueType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (o *Wfmbushorttermforecastimportcompletetopicbuforecastmodification) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (m *DiseaseMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase disease.FieldName:\n\t\tv, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetName(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Disease field %s\", name)\n}", "func (me *TPointsType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TxsdContactType) Set(s string) { (*xsdt.Nmtoken)(me).Set(s) }", "func (me *TFilterValueType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TSAFPTtextTypeMandatoryMax100Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TAttlistSupplMeshNameType) Set(s string) { (*xsdt.Token)(me).Set(s) }", "func (me *TrestrictionType) Set(s string) { (*xsdt.Nmtoken)(me).Set(s) }", "func (me *TViewBoxSpecType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (f *Field) Set(l *Location, val string, seps *Delimeters) error {\n\tloc := l.Comp\n\tif loc < 0 {\n\t\tloc = 0\n\t}\n\tif x := loc - len(f.Components) + 1; x > 0 {\n\t\tf.Components = append(f.Components, make([]Component, x)...)\n\t}\n\terr := f.Components[loc].Set(l, val, seps)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.Value = f.encode(seps)\n\treturn nil\n}", "func (o *Oauthclientrequest) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (me *TxsdInvoiceType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TSAFPTtextTypeMandatoryMax90Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TKerningValue) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TSAFPTtextTypeMandatoryMax50Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (f *Fields) Set(s []*Field)", "func (me *TMaskValueType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (o *Integrationtype) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (me *TSAFPTtextTypeMandatoryMax35Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TSAFPTtextTypeMax40Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TSAFPTtextTypeMandatoryMax255Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TSAFPTtextTypeMandatoryMax200Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TNumberOrPercentageType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (o *Contentmanagementworkspacedocumentstopicdocumentdatav2) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (me *TSAFPTtextTypeMandatoryMax254Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func ExamplePerson_SetName() {\n\tperson := NewPerson(\"alice\")\n\tperson.SetName(\"bob\")\n}", "func (m *DiseasetypeMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase diseasetype.FieldDiseaseTypeName:\n\t\tv, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetDiseaseTypeName(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Diseasetype field %s\", name)\n}", "func (me *TSAFPTtextTypeMandatoryMax210Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (m *SeriesMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase series.FieldName:\n\t\tv, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetName(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Series field %s\", name)\n}", "func (o *Webchatmemberinfo) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (me *TSAFTaxonomyCode) Set(s string) { (*xsdt.Integer)(me).Set(s) }", "func (me *TSAFPTHashControl) Set(s string) { (*xsdt.String)(me).Set(s) }", "func SetField(obj interface{}, name string, value interface{}) error {\n\tstructValue := reflect.ValueOf(obj).Elem()\n\tstructFieldValue := structValue.FieldByName(name)\n\n\tif !structFieldValue.IsValid() {\n\t\treturn fmt.Errorf(\"No such field: %s in obj\", name)\n\t}\n\n\tif !structFieldValue.CanSet() {\n\t\treturn fmt.Errorf(\"Cannot set %s field value\", name)\n\t}\n\n\tstructFieldType := structFieldValue.Type()\n\tval := reflect.ValueOf(value)\n\tif structFieldType != val.Type() {\n\t\treturn errors.New(\"Provided value type didn't match obj field type\")\n\t}\n\n\tstructFieldValue.Set(val)\n\treturn nil\n}", "func (me *TStrokeMiterLimitValueType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (f *Field) Set(val interface{}) error {\n\t// we can't set unexported fields, so be sure this field is exported\n\tif !f.IsExported() {\n\t\treturn errNotExported\n\t}\n\n\t// do we get here? not sure...\n\tif !f.value.CanSet() {\n\t\treturn errNotSettable\n\t}\n\n\tgiven := reflect.ValueOf(val)\n\n\tif f.value.Kind() != given.Kind() {\n\t\treturn fmt.Errorf(\"wrong kind. got: %s want: %s\", given.Kind(), f.value.Kind())\n\t}\n\n\tf.value.Set(given)\n\treturn nil\n}", "func (me *TSAFPTtextTypeMandatoryMax70Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TdurationType) Set(s string) { (*xsdt.Nmtoken)(me).Set(s) }", "func (m *NametitleMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase nametitle.FieldTitle:\n\t\tv, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetTitle(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Nametitle field %s\", name)\n}", "func (me *TSAFPTtextTypeMandatoryMax20Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TshapeEnumType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TClipFillRuleType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (e *Engine) setName(name string) error {\n\tindex, err := naming.ExtractIndex(name, \"-\", 1)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"couldn't get index from device name: %v\", err)\n\t\treturn err\n\t}\n\te.Name = name\n\te.Index = index\n\treturn nil\n}", "func (o *Directrouting) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (o *Posttextresponse) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (me *TxsdThoroughfareDependentThoroughfares) Set(s string) { (*xsdt.Nmtoken)(me).Set(s) }", "func (me *TartIdType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TClipPathValueType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (o *Digitalcondition) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (me *TNumbersType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TAttlistDescriptorNameType) Set(s string) { (*xsdt.Token)(me).Set(s) }", "func (me *TSAFPTtextTypeMandatoryMax10Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func setField(obj interface{}, name string, value interface{}) error {\n\tstructValue := reflect.ValueOf(obj).Elem()\n\tstructType := reflect.TypeOf(obj).Elem()\n\tstructFieldValue := structValue.FieldByName(name)\n\n\tfor i := 0; i < structType.NumField(); i++ {\n\t\tfield := structType.Field(i)\n\t\ttag := field.Tag.Get(\"query\")\n\n\t\tif tag == name {\n\t\t\tstructFieldValue = structValue.Field(i)\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !structFieldValue.IsValid() || !structFieldValue.CanSet() {\n\t\treturn errors.New(fmt.Sprintf(\"%s is not allowed\", name))\n\t}\n\n\tstructFieldType := structFieldValue.Type()\n\tval := reflect.ValueOf(value)\n\n\tif structFieldType.Kind() == reflect.Bool {\n\t\tswitch val.String() {\n\t\tcase \"false\":\n\t\t\tstructFieldValue.SetBool(false)\n\t\t\treturn nil\n\t\tcase \"true\":\n\t\t\tstructFieldValue.SetBool(true)\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn errors.New(fmt.Sprintf(\"%s must be a boolean\", name))\n\t\t}\n\t} else {\n\t\tstructFieldValue.Set(val)\n\t\treturn nil\n\t}\n}", "func (m *ClassifierMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase classifier.FieldEQUIPMENTCLASSIFIER:\n\t\tv, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetEQUIPMENTCLASSIFIER(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Classifier field %s\", name)\n}", "func (me *TPortlistType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TMediaDescType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (m *CompanyMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase company.FieldName:\n\t\tv, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetName(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Company field %s\", name)\n}", "func (o *Outcomequantilecondition) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (me *TxsdAnimateTransformTypeType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (o *Wfmintradaydataupdatetopicintradayhistoricalqueuedata) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func (m *SettlementMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase settlement.FieldX:\n\t\tv, ok := value.(int)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetX(v)\n\t\treturn nil\n\tcase settlement.FieldY:\n\t\tv, ok := value.(int)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetY(v)\n\t\treturn nil\n\tcase settlement.FieldIsCity:\n\t\tv, ok := value.(bool)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetIsCity(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Settlement field %s\", name)\n}", "func (me *TSAFPTtextTypeMandatoryMax30Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TSAFPTtextTypeMandatoryMax60Car) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (o *Appevent) SetField(field string, fieldValue interface{}) {\n\t// Get Value object for field\n\ttarget := reflect.ValueOf(o)\n\ttargetField := reflect.Indirect(target).FieldByName(field)\n\n\t// Set value\n\tif fieldValue != nil {\n\t\ttargetField.Set(reflect.ValueOf(fieldValue))\n\t} else {\n\t\t// Must create a new Value (creates **type) then get its element (*type), which will be nil pointer of the appropriate type\n\t\tx := reflect.Indirect(reflect.New(targetField.Type()))\n\t\ttargetField.Set(x)\n\t}\n\n\t// Add field to set field names list\n\tif o.SetFieldNames == nil {\n\t\to.SetFieldNames = make(map[string]bool)\n\t}\n\to.SetFieldNames[field] = true\n}", "func setField(obj interface{}, name string, value interface{}) error {\n\tstructValue := reflect.ValueOf(obj).Elem()\n\tstructFieldValue := structValue.FieldByName(name)\n\n\tif !structFieldValue.IsValid() {\n\t\treturn fmt.Errorf(\"No such field: %s in obj\", name)\n\t}\n\n\tif !structFieldValue.CanSet() {\n\t\treturn fmt.Errorf(\"Cannot set %s field value\", name)\n\t}\n\n\tstructFieldType := structFieldValue.Type()\n\n\tvar val reflect.Value\n\tswitch structFieldType.String() {\n\tcase \"int\":\n\t\ti, _ := strconv.Atoi(value.(js.Value).String())\n\t\tval = reflect.ValueOf(i)\n\t\tbreak\n\tcase \"float64\":\n\t\ti, _ := strconv.ParseFloat(value.(js.Value).String(), 64)\n\t\tval = reflect.ValueOf(i)\n\t\tbreak\n\tcase \"bool\":\n\t\ti, _ := strconv.ParseBool(value.(js.Value).String())\n\t\tval = reflect.ValueOf(i)\n\t\tbreak\n\tcase \"string\":\n\t\tval = reflect.ValueOf(value.(js.Value).String())\n\t\tbreak\n\tdefault:\n\t\tval = reflect.ValueOf(value)\n\t\tbreak\n\t}\n\n\tstructFieldValue.Set(val)\n\treturn nil\n}", "func (me *TOpacityValueType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TScriptType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TContentTypeType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TSAFTPTSourceBilling) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TSAFPTGLAccountID) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (s *StructField) Set(v interface{}) error {\n\tif s.field.PkgPath != \"\" {\n\t\treturn errors.New(\"Field is not exported\")\n\t}\n\n\tif !s.CanSet() {\n\t\treturn errors.New(\"Field cannot be set\")\n\t}\n\n\tgiven := reflect.ValueOf(v)\n\n\tif s.value.Kind() != given.Kind() {\n\t\treturn errors.New(\"Field and value kind don't match\")\n\t}\n\n\ts.value.Set(given)\n\treturn nil\n}", "func (me *TransformListType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (blood *bloodGeneral) Set(name string, value float64) {\n\te := reflect.ValueOf(blood).Elem()\n\tfield := e.FieldByName(name)\n\tif field.IsValid() && field.CanSet() && field.Kind() == reflect.Float64 {\n\t\tfield.SetFloat(value)\n\t} else {\n\t\tpanic(\"Cannot find \" + name + \" in BloodGeneral struct\")\n\t}\n\n\treturn\n}", "func (m *StreetMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase street.FieldName:\n\t\tv, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetName(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Street field %s\", name)\n}", "func (m *BedtypeMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase bedtype.FieldBedtypename:\n\t\tv, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetBedtypename(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Bedtype field %s\", name)\n}", "func (me *TxsdImpactSimpleContentExtensionType) Set(s string) { (*xsdt.Nmtoken)(me).Set(s) }", "func (me *TxsdMovementType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (m *CategoryMutation) SetField(name string, value ent.Value) error {\n\tswitch name {\n\tcase category.FieldName:\n\t\tv, ok := value.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unexpected type %T for field %s\", value, name)\n\t\t}\n\t\tm.SetName(v)\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unknown Category field %s\", name)\n}", "func (me *TcoordinatesType) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TxsdFeMorphologyTypeOperator) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (me *TxsdPremiseNumberNumberType) Set(s string) { (*xsdt.Nmtoken)(me).Set(s) }", "func (f *FieldHeaderNames) Set(value string) error {\n\t// When arguments are passed through YAML, escaped double quotes\n\t// might be added to this string, and they would break the last\n\t// key/value pair. This ensures the string is clean.\n\tvalue = strings.Trim(value, \"\\\"\")\n\n\tfields := strings.Fields(value)\n\n\tfor _, field := range fields {\n\t\tn := strings.SplitN(field, \"=\", 2)\n\t\t(*f)[n[0]] = n[1]\n\t}\n\n\treturn nil\n}", "func (m *LabelActionBase) SetName(value *string)() {\n err := m.GetBackingStore().Set(\"name\", value)\n if err != nil {\n panic(err)\n }\n}" ]
[ "0.6978644", "0.67127097", "0.6554158", "0.6535701", "0.648949", "0.6488116", "0.64872724", "0.64611167", "0.641035", "0.63914317", "0.6386742", "0.6377272", "0.63651955", "0.6351144", "0.6337588", "0.6311778", "0.6311778", "0.6304745", "0.62829113", "0.6272751", "0.6268671", "0.6266285", "0.6265865", "0.6253639", "0.62447006", "0.6232831", "0.62251157", "0.6221833", "0.62189144", "0.6212537", "0.62094635", "0.6209313", "0.6204735", "0.6202101", "0.61937445", "0.6192035", "0.6189462", "0.61840737", "0.61809164", "0.6176772", "0.61750937", "0.61733145", "0.6157459", "0.61512333", "0.61440337", "0.61427486", "0.61419475", "0.6137599", "0.6128708", "0.6127297", "0.612435", "0.61233217", "0.6111386", "0.61098164", "0.610855", "0.61011183", "0.6099003", "0.60969484", "0.6093712", "0.6089691", "0.6086111", "0.60800856", "0.60796374", "0.60786676", "0.60735166", "0.6071955", "0.6071905", "0.60712224", "0.60553825", "0.6054341", "0.6053531", "0.6053113", "0.6051501", "0.60495913", "0.6046556", "0.60453755", "0.6043941", "0.6043066", "0.60420644", "0.60407996", "0.6040585", "0.6040419", "0.6040081", "0.6036135", "0.6031209", "0.6027033", "0.602659", "0.6026208", "0.6025597", "0.60237217", "0.6018427", "0.60161626", "0.601538", "0.6014008", "0.6012201", "0.6012091", "0.6008574", "0.600484", "0.60046756", "0.6004388", "0.6003529" ]
0.0
-1
GetClusters returns the Clusters field value
"func (o *QueueManager) GetClusters() []string {\n\tif o == nil {\n\t\tvar ret []string\n\t\treturn(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["func (c *Config) GetClusters(ctx context.Context, quiet bool, filterMap map[string]string, cluster(...TRUNCATED)
["0.7150111","0.70848936","0.7050372","0.69830257","0.69812804","0.68225586","0.6785897","0.67075115(...TRUNCATED)
0.76226926
0
"GetClustersOk returns a tuple with the Clusters field value and a boolean to check if the value has(...TRUNCATED)
"func (o *QueueManager) GetClustersOk() (*[]string, bool) {\n\tif o == nil {\n\t\treturn nil, false(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["func NewGetClustersOK() *GetClustersOK {\n\treturn &GetClustersOK{}\n}","func (o *ResourceLimits) (...TRUNCATED)
["0.6719827","0.65017885","0.6465093","0.646219","0.6398727","0.63660103","0.63552487","0.63049424",(...TRUNCATED)
0.8224033
0
SetClusters sets field value
func (o *QueueManager) SetClusters(v []string) { o.Clusters = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["func (s *RaftDatabase) SetClusters(clusters int) {\n\ts.clusters = clusters\n}","func (s *RaftData(...TRUNCATED)
["0.623222","0.5735698","0.55403745","0.5447475","0.5413994","0.5402886","0.53507334","0.5320656","0(...TRUNCATED)
0.680183
0
GetAliasQueues returns the AliasQueues field value
"func (o *QueueManager) GetAliasQueues() []AliasQueue {\n\tif o == nil {\n\t\tvar ret []AliasQueue\(...TRUNCATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
["func (o *QueueManager) GetAliasQueuesOk() (*[]AliasQueue, bool) {\n\tif o == nil {\n\t\treturn ni(...TRUNCATED)
["0.69151425","0.6435573","0.6247431","0.6227677","0.6098082","0.59897524","0.58581173","0.5692911",(...TRUNCATED)
0.7781025
0

No dataset card yet

Downloads last month
151